[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.
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
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.
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.
...(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.
Insomnia is just a byproduct of, "It can't be done"
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.
Last edited by jmsrickland; Feb 28th, 2009 at 11:33 PM.
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...
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread "Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
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.
Last edited by jmsrickland; Feb 28th, 2009 at 11:35 PM.