View previous topic :: View next topic |
Author |
Message |
zile Advanced Cheater
Reputation: 0
Joined: 11 Jul 2009 Posts: 75
|
Posted: Tue Sep 27, 2011 6:50 am Post subject: [VC++]Default Push Button for a Tab |
|
|
I have a main dialogbox with a tab control, and i created a tab ( as child window ) in the tab's window. i have a button and an edit control in the tab to send messages(texts). how do i enable it to auto push the send button when i press enter after entering text in the edit control?
i tried setting the button as DEFPUSHBUTTON but it doesnt work
- i tried setting a button on the Main dialogbox(not tab) as default push button and it works fine, but somehow if its in the tab it doesnt work. any way to get this working?
|
|
Back to top |
|
 |
Josheh Expert Cheater
Reputation: 1
Joined: 28 Aug 2011 Posts: 155
|
Posted: Tue Sep 27, 2011 2:11 pm Post subject: |
|
|
I'n not sure what you're asking exactly, but you could hook the keyboard to see if certain keys are pressed, then invoke the button? I dunno I'm sorry. I'm a Java boy
EDIT: Or if you can get which key is pressed in the TextBox (IDK I guess a KeyCode?) to see if it's the Enter key then invoke the button?
|
|
Back to top |
|
 |
NoMercy Master Cheater
Reputation: 1
Joined: 09 Feb 2009 Posts: 289
|
Posted: Tue Sep 27, 2011 2:46 pm Post subject: |
|
|
I'm not sure buy I guess that the owner of the button is not the main window but the tapWindow? Guess you should set that window as reciever or something. I'm not sure just guessing? Perhaps SS_OWERDRAW could help you here?
|
|
Back to top |
|
 |
zile Advanced Cheater
Reputation: 0
Joined: 11 Jul 2009 Posts: 75
|
Posted: Tue Sep 27, 2011 9:48 pm Post subject: |
|
|
I mean i have a tab ( child dialogbox ) in a parent dialogbox. when i set a default button on the tabwindow, it doesnt work. only the parent dialogbox's default button works
im guessing it only checks for the parent's default button not the tab's.
i checked ss_ownerdraw, is it only for painting the button?
josheh's suggestion seems like the way to do it..ill try looking into that
|
|
Back to top |
|
 |
|