Windows Develop Bookmark and Share   
 index > Windows Forms General > How to disable button outline?
 

How to disable button outline?

Hi, Is it possible to disable a button outline when it receives focus? In fact, it is not a button I am using,

I am using SpinButton (COM Control) and as I need it to be very small, when the spinbutton gets focus,

it is outlined and the SpinUp and SpinDown arrows get covered up byt the outline. I tried overriding

the SpinButton control to disable ShowFocusCues. But it is read-only, so I got in a dead end. Any ideas?

Code Block

namespace MeuSpinButton

{

public class MeuSpinButton : AxMSForms.AxSpinButton

{

public bool ExibirOutline

{

get

{

return base.ShowFocusCues;

}

set

{

base.ShowFocusCues = value;

}

}

}

}

Fábio Franco  Monday, October 01, 2007 5:54 PM
Yes, UpDownBase has the protected UpButton and DownButton methods.
nobugz  Monday, October 01, 2007 6:48 PM
The control itself is responsible for showing its focus rectangle or indicator. If that covers up parts of the UI, you'd better give up on the control. ShowFocusCues does something else, it determines whether or not the shortcut key letter is underlined. Which more than likely wouldn't work on an ActiveX control anyway. Not sure what a "SpinButton" does, perhaps a NumericUpDown or its UpDownBase base control could be a replacement.
nobugz  Monday, October 01, 2007 6:22 PM

Yeah, I was giving it up already. The problem with the numericUpDown is that it has no event to "SpinUp" and "SpinDown" only a ValueChanged eventand what I want is to increment and decrement a DateTimevaluein a masked text box. I will

check this UpDown base class, maybe it has an Up and Down events. I will get back here If I cant get it to work.

But thanks for the help.

Regards,

Fábio

Fábio Franco  Monday, October 01, 2007 6:29 PM
Yes, UpDownBase has the protected UpButton and DownButton methods.
nobugz  Monday, October 01, 2007 6:48 PM

You can use google to search for other answers

Custom Search

More Threads

• XML Document read write with VB.NET iusing datasets
• Snappable grid
• How to enable textBox to display Asian letter(Korea, Japanese, Chinese, Thailand, etc.)?
• Using the default drag-copy icon
• Are icons with alpha channel supported?
• How to display caps lock and num lock status on status bar
• Assigning an object to a DataGridView column
• ListBox with images
• DoDragDrop on TreeView Problem
• Scrolling while moving the control at runtime over a FORM