|
-
Oct 31st, 2000, 05:27 PM
#1
Thread Starter
Frenzied Member
Anyone know how to set the focus to a button on a form?
Or maybe how to change the tabstop order?
MSVS 6, .NET & .NET 2003 Pro
I HATE MSDN with .NET & .NET 2003!!!
Check out my sites:
http://www.filthyhands.com
http://www.techno-coding.com

-
Oct 31st, 2000, 05:50 PM
#2
Frenzied Member
Code:
SendMessage(handleofbutton,WM_SETFOCUS,0,0);
-
Oct 31st, 2000, 06:09 PM
#3
You shouldnt use SendMessage, you should use SetFocus(hWnd).
-
Oct 31st, 2000, 07:19 PM
#4
Thread Starter
Frenzied Member
How is there an easy way to get the hWnd of a button on my form??
MSVS 6, .NET & .NET 2003 Pro
I HATE MSDN with .NET & .NET 2003!!!
Check out my sites:
http://www.filthyhands.com
http://www.techno-coding.com

-
Oct 31st, 2000, 07:23 PM
#5
hControl= GetDlgItem(hDialog, BUTTON_ID);
-
Oct 31st, 2000, 07:25 PM
#6
Thread Starter
Frenzied Member
MSVS 6, .NET & .NET 2003 Pro
I HATE MSDN with .NET & .NET 2003!!!
Check out my sites:
http://www.filthyhands.com
http://www.techno-coding.com

-
Nov 1st, 2000, 07:20 AM
#7
Couldn't you use FindWindow to get a window's handle?
Code:
hWin = FindWindow(NULL,"Caption");
-
Nov 1st, 2000, 09:07 AM
#8
Frenzied Member
What if two windows have the same caption?
Harry.
"From one thing, know ten thousand things."
-
Nov 1st, 2000, 01:57 PM
#9
Monday Morning Lunatic
You get the first window created (I think). Anyway, you'll always have the handle, because if it's a dialogue, use GetDlgItem, and if it's window, you'd have received the handle in the call to CreateWindowEx.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|