[RESOLVED] Remove the checker border from command button
Hi, this may be a dumb question but, I have an intro form to my project and it has only 2 command buttons and nothing else. The form is displaying a picture in the back ground and the buttons both have pictures. There is a checkerd "got focus" border around one of the buttons. I want both buttons to not have the checker border.
Thank you,
Re: Remove the checker border from command button
I don't know of a way to turn off the focus rect of a VB command button, but if this is just for the start up apperance you could add say an option control to the form, move it out of view and set focus on it.
Code:
Private Sub Form_Load()
Option1.Top = (-Option1.Height)
Me.Show
DoEvents
Option1.SetFocus
End Sub
Re: Remove the checker border from command button
Why do you even have to have the code for the option control? If you add Option1, then Command1 on top of the Option control and then add Command2 and then run the program neither Command button has the dotted focus border.
Re: Remove the checker border from command button
Quote:
Originally Posted by jmsrickland
Why do you even have to have the code for the option control? If you add Option1, then Command1 on top of the Option control and then add Command2 and then run the program neither Command button has the dotted focus border.
True, guess I'm just used to working with a lot of transparent controls and got into that habit.
1 Attachment(s)
Re: Remove the checker border from command button
The other option is to use two Image Controls instead of Commanbutton. I have used this for one of my application and the user like it very much...
I have atttached an example
Edit:
Sorry forgot to add images... updated that
Re: Remove the checker border from command button
Thanks every one, great ideas. I ended up hiding another command button and putting focus on that.
Koolsid, I never thought of going that way. That is pretty neat. Where did you find those icons?
Re: Remove the checker border from command button
I created them in Bitmap :)
So if your query is solved, then do remmebr to mark this thread resolved ;)
Re: Remove the checker border from command button
Quote:
Originally Posted by jmsrickland
...(regarding Edgemeal's post #2) ... Why do you even have to have the code for the option control? If you add Option1, then Command1 on top of the Option control and then add Command2 and then run the program neither Command button has the dotted focus border.
It is probably better to move it out of the way as EdgeMeal described. This way should the command button be moved, resized or hidden with/without the user knowing it (think of some resizing utils that can resize all controls), the option button won't be seen. One cannot make it invisible either because you cannot set focus to an invisible control.
Re: [RESOLVED] Remove the checker border from command button
Well, OK, wheather it's under the button or off the Form it's the same thing. All that has to be done is that the Option control be the first control made (move it off the Form then if that makes it better). That was my point, not wheather it is under a button, off the Form or whatever.
Re: [RESOLVED] Remove the checker border from command button
The only challenge I see here in case of using an option button or as a matter of fact any control which is hidden behind other control or anywhere in the form is that if the users presses tab to cycle between controls, then at one point the user might be perplexed that the focus disappears... just a thought...
Re: [RESOLVED] Remove the checker border from command button
Not if the two Command buttons have their TabStops set to False or have all three controls with a False TabStop; in either case that will stop the focus until the user presses a button. I really got the impression that the OP just wanted the two buttons not to have the focus at startup but even so it doesn't matter if that is not exactly what he wanted.