| | |
button background colour on mouse enter event
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Apr 2008
Posts: 114
Reputation:
Solved Threads: 6
I trying to create some, what i thought, simple rollover buttons. everything works fine except that the background colour on the mouse enter is always different to what i set.
I have tried all the different flat settings on if set to 'flat' the background colour allways appears different despite to to directly set the colour - if i set the flat to 'popup' then the background colour changes fine but the borders go all funny on the mouse enter.
I just wondered if anyone had any ideas - my button code is below
cheers
I have tried all the different flat settings on if set to 'flat' the background colour allways appears different despite to to directly set the colour - if i set the flat to 'popup' then the background colour changes fine but the borders go all funny on the mouse enter.
I just wondered if anyone had any ideas - my button code is below
cheers
VB.NET Syntax (Toggle Plain Text)
Private Sub Button5_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button5.MouseEnter Button5.Image = My.Resources.Left Button5.FlatStyle = FlatStyle.Popup Button5.BackColor = Color.MistyRose End Sub Private Sub Button5_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button5.MouseLeave Button5.Image = My.Resources.Left_down Button5.FlatStyle = FlatStyle.Popup Button5.BackColor = Color.MistyRose End Sub
I tried your code and it changes bg-color just fine. I changed FlatStyle.Flat and bg-color still changes fine.
If you set FlatStyle.Flat, have you checked FlatAppearance properties (borders & colors)? It seems FlatAppearance properties are design time props and are ReadOnly in the run-time. Anyway, changing FlatAppearance may solve your problem.
If you set FlatStyle.Flat, have you checked FlatAppearance properties (borders & colors)? It seems FlatAppearance properties are design time props and are ReadOnly in the run-time. Anyway, changing FlatAppearance may solve your problem.
Teme64 @ Windows Developer Blog
![]() |
Other Threads in the VB.NET Forum
- Previous Thread: Convert HTML file to PDF file through code
- Next Thread: detecting delete on row in datagridview and updating dataset
| Thread Tools | Search this Thread |
.net .net2008 2008 access account add advanced application array basic beginner browser button buttons click code combo cpu cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic employees excel exists fade filter forms generatetags html images input intel internet listview mobile module monitor mysql net number objects open panel pdf picturebox picturebox2 port position print printing printpreview problem regex reuse right-to-left save search searchvb.net select serial settings shutdown socket sqldatbase sqlserver storedprocedure survey temperature textbox timer timespan transparency txttoxmlconverter update user usercontol vb vb.net vb.netformclosing()eventpictureboxmessagebox vba vbnet vista visual visualbasic.net visualstudio.net visualstudio2008 web winforms wpf wrapingcode xml year





