!!! Newb Alert !!!
I am trying to figure how the sample plugin project here is changing the color on the button in plugin number 2.
Would someone please explain to me how this is being done.
Thanks Steve
Printable View
!!! Newb Alert !!!
I am trying to figure how the sample plugin project here is changing the color on the button in plugin number 2.
Would someone please explain to me how this is being done.
Thanks Steve
That link produces an error page for me. But you can easily change the backcolor property
You have to manualy add the event handlers of course.Code:private void button1_MousEnter(object sender, System.EventArgs e)
{
((Button)sender).BackColor = Color.Red;
}
private void butto1_MouseLeave(object sender, System.EventArgs e)
{
((Button)sender).BackColor = this.BackColor;
}
Also: this wouldn't work with XP-styles
The link worked just fine for me. Maybe the site was having issues when you tried.
That happened with me, I did a refresh on the browser and I was able to get it to load. I think their server gets overloaded.Quote:
Originally Posted by grilkip
As far as the MouseEnter MouseLeave events I could not find anywhere in their code where these events were setup. Again I am new so I may not have looked in all of the right spots.
I have also read about having your app use XP Styles but I did not know where that would be setup either.
You can enable XP visual styles in your app by calling Application.EnableVisualStyles() in your Main method. If you use any ImageList components then you need to follow that with a call to Application.DoEvents() or you will have issues. You then need to set the FlatStyle property to System for all controls that support it. You can also use a manifest file, but that is a pain in the b*tt, and I gave up trying soon after I started. There are still issues with the visual style support in Visual Studio, like the fact that you cannot put images on Buttons and UpDown controls don't support visual styles at all. To overcome the vast majority of these issues, you can dowload the free VisualStyles component from www.skybound.ca. You simply add a VisualStyleProvider component to each form and call VisualStyleProvider.EnableVisualStyles() in your Main method instead and voila! No need to set the FlatStyle properties either. You can remove visual style support for individual controls if you want to. The only issues with this could be that in some shops developers cannot use third party components, and forms with a very large number of controls can run more slowly. To help in this situation you can disable VisualStyleProvider support for those controls that display correctly using the FlatStyle property.
Thank you very much, that was it the EnableVisualStyles was set. Thanks for the info on the skybound tools I will take a look at them.