Aaron wrote:Hi,
The FlatStyle "Flat" does not work for this SplitButton. Do you have an idea how i can accomplish that?
Thanks,
Aaron
The flat style is not a theme-inherited style - that is, it doesn't look like the themed buttons in Vista & XP. This means it will not change from one version of Windows to another. So, to accomplish the 'Flat' look is actually a rather simple task.
Just open up the project in Visual Studio (or whichever development environment you use) and edit the 'OnPaint(PaintEventArgs pevent)' method in the SplitButton.cs file. Then it's just a matter of replacing the existing code with a switch statement for each of the button's states:
- Code: Select all
switch(State)
{
case PushButtonState.Default:
//TODO: insert painting code
break;
case PushButtonState.Disabled:
//TODO: insert painting code
break;
case PushButtonState.Hot:
//TODO: insert painting code
break;
case PushButtonState.Normal:
//TODO: insert painting code
break;
case PushButtonState.Pressed:
//TODO: insert painting code
break;
}
Then where each comment is, replace it with drawing code that draws the rectangle background and the 1px/2px black frame for that particular button state.
The reason I didn't (and won't) implement the alternate FlatStyles is because they look amateur.
However, if you're developing for a client with those particular stylistic needs, then who am I to impose my own standards?