|
-
Sep 1st, 2005, 10:16 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] Mouse Over Buttons
!!! 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
Last edited by steve65; Sep 1st, 2005 at 08:43 PM.
This space for rent...
-
Sep 1st, 2005, 11:41 AM
#2
Fanatic Member
Re: Mouse Over Buttons
That link produces an error page for me. But you can easily change the backcolor property
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;
}
You have to manualy add the event handlers of course.
Also: this wouldn't work with XP-styles
"so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman
-
Sep 1st, 2005, 01:19 PM
#3
Re: Mouse Over Buttons
The link worked just fine for me. Maybe the site was having issues when you tried.
-
Sep 1st, 2005, 03:11 PM
#4
Thread Starter
Fanatic Member
Re: Mouse Over Buttons
 Originally Posted by grilkip
That link produces an error page for me. You have to manualy add the event handlers of course.
Also: this wouldn't work with XP-styles
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.
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.
-
Sep 1st, 2005, 05:24 PM
#5
Re: Mouse Over Buttons
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.
-
Sep 1st, 2005, 08:36 PM
#6
Thread Starter
Fanatic Member
Re: Mouse Over Buttons
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|