Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removal of focus rectangle on buttons

Status
Not open for further replies.

robdon

Programmer
May 21, 2001
252
ES
Hi,

Is there a way to stop the 'focus rectangle' appearing on buttons.

Most applications dont seem to have this, but all mine that I do in VB, have a focus rectangle around the button. On a small buttons this rectangle interfears with the text on it.

API call maybe??

Thanks,

Rob Donovan
 
What about replacing the buttons with image controls?
 
Using an image control is one way. The problem (or maybe not depending on use) with that control is that there is no CausesValidation property. The Picture box would work in that case, but it uses alot of ressources. A user control would be best.

Or, the easy route, use the command button from MS Forms 2.0 (add a reference under Project|Controls). This control has a property called TakeFocusOnClick. When set to false, and a user clicks on it, it executes but it doesn't receive the focus and consequently has no focus rectangle.

You may use these controls in your distributed project, but you may not distribute the controls themselves (fm20.dll). Most OS, especially the newer ones, and most any OS with IE 3+ should already have the dll on their systems - I even find it on systems with nothing more than Win 95 and IE 4.x.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top