How can an Enter Keypress be used to access a method

How can an Enter Keypress in a text box be used to access a method. I saw the thread below but it's written in Delphi. I need to see an example in C++. I'm very new to both C++ and the Rad Studio environment. Ultimately what I'd like to do is after a user types a password, I'd them to be able to just hit enter to enter the site. As well as clicking a login button. I can create an OnKeyPress event below. But I'm not sure what to do with it.
Delphi Link = https://www.cgdevtools.com/cgforum/viewtopic.php?f=101&t=828
Thanks
- Code: Select all
void __fastcall TfrmMain::txtAgencyJQEventsKeyPress(TObject *Sender, TStringList *AParams)
{
}
Delphi Link = https://www.cgdevtools.com/cgforum/viewtopic.php?f=101&t=828
Thanks