|
-
Sep 13th, 2000, 03:06 PM
#1
I am somewhat new to VB having only used it about a year now. My question is this, when I generate a message box with the vbYes_No option, is there a way to set the focus to the No option rather than the Yes option that it defaults to?
-
Sep 13th, 2000, 03:13 PM
#2
This should work:
Code:
SendKeys "{TAB}"
YesNo = MsgBox("Yes/No?", 4 + 32)
-
Sep 13th, 2000, 03:17 PM
#3
Thanks that worked great! And so simple too.
-
Sep 13th, 2000, 03:18 PM
#4
Or use
MsgBox "Yes/No with default as No", vbYesNo + vbDefaultButton2
-
Sep 13th, 2000, 03:19 PM
#5
Fanatic Member
This will also work:
Code:
MsgBox "Hello", vbYesNo + vbDefaultButton2, "Hello"
Sorry Sarun, we posted at the same time
GWDASH
[b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]
-
Dec 6th, 2000, 03:20 PM
#6
New Member
Follow-up question
I am using a vbYesNo message box that I really want my users to pay attention to. Thus, I don't want a default button or they will just hit enter and cruise right bye. I have tried setting the default to a non-existent 3rd button but it still stayed at the first button.
1st - 0
2nd - 256
3rd - 512
-
Dec 7th, 2000, 07:28 AM
#7
what I would do would be build a simple form with a label, and two command buttons (yes and no) If you build this right the end user would not notice the difference between the a message box and a form. The trick is you can set up a very small text box (possibly not visible, alothough I don't remember if it can recieve focus if it is not visible) with background and borders set to clear. Then put the focus in this box. That way your end user has to select whether it is yes or no.
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
|