Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

changing font colour on labels. 2

Status
Not open for further replies.

SpectacledBear

Programmer
Mar 1, 2005
58
0
0
GB
I have the same code on 8 labels (a switchboard) and the first two turn red on mousemoe, then black when the mouse moves away, but the other six don't, even though the code is the same. Does anyone know why?
 
[ul]
[li] What type of code you are using? Is that individual or common for all?[/li]
[li] If individual are you sure you have placed the code on MouseMoveEvent?[/li]
[li] Are the labels bound to any other controls?[/li]
[li] Are you sure the labels are not corrupted?[/li]
[/ul]


Zameer Abdulla
[sub]Jack of Visual Basic Programming, Master in Dining & Sleeping[/sub]
Visit Me
 
This is the code I am using:

Private Sub OptionLabel1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Me.OptionLabel1.ForeColor = vbRed

End Sub

Private Sub OptionLabel2_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Me.OptionLabel2.ForeColor = vbRed

End Sub

Private Sub OptionLabel3_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Me.OptionLabel3.ForeColor = vbRed

End Sub

Private Sub OptionLabel4_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Me.OptionLabel4.ForeColor = vbRed

End Sub

Private Sub OptionLabel5_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Me.OptionLabel5.ForeColor = vbRed

End Sub

Private Sub OptionLabel6_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Me.OptionLabel6.ForeColor = vbRed

End Sub

Private Sub OptionLabel7_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Me.OptionLabel7.ForeColor = vbRed

End Sub

Private Sub OptionLabel8_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Me.OptionLabel8.ForeColor = vbRed

End Sub
Private Sub Detail_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)

Me.OptionLabel1.ForeColor = vbBlack
Me.OptionLabel2.ForeColor = vbBlack
Me.OptionLabel3.ForeColor = vbBlack
Me.OptionLabel4.ForeColor = vbBlack
Me.OptionLabel5.ForeColor = vbBlack
Me.OptionLabel6.ForeColor = vbBlack
Me.OptionLabel7.ForeColor = vbBlack
Me.OptionLabel8.ForeColor = vbBlack

End Sub

All of the labels are the same, automatically created using switchboard manager. The first two labels are functioning corectly, nothing happens on the other six.
 
I can't find anything wrong in this code. Either all the six labels are corrupted or there is no "EventProcedure" written on the property box. Check the property box or try recreating the labels that are not working

Zameer Abdulla
[sub]Jack of Visual Basic Programming, Master in Dining & Sleeping[/sub]
Visit Me
 
Thanks for the advice :D.

Checked all the event procedures and they were there, so it must be the labels. Will try creating them again and will let you know how i get on. Thanks!
 
You might be knowing still a reminder..
If you have done a lot of design work then have a Compact & Repair
TOOLS > DATABASE UTILITIES > COMPACT & REPAIR

Zameer Abdulla
[sub]Jack of Visual Basic Programming, Master in Dining & Sleeping[/sub]
Visit Me
 
Hi, you've just reminded me theres a problem with that. Whn i try to compact and repair my database, it says something like the table MStempAccessObjects already exists, and then closes the system. Why is that?
 
Some type of corruption, see PRB: "Table 'TempMSysAccessObjects' Already Exists" Error Message May Occur While Using the Compact and Repair Database Utility for info and some workarounds.

If you're unsure there might be code corruption too, try Decompile or how to reduce Microsoft Access MDB/MDE size and decrease start-up times too, which is often able to resolve code corruption, even though it is marketed as something else;-)

Roy-Vidar
 
Thanks Roy Vidar, and thanks Zameer Abdulla, it seems the labels were corrupted. Both have a star :)
 
Today, while I was testing a sample DB created by some one, I got the same error message from the DB. I didn't understand what it was. This db was using code to shutdown the db if it was not active for certain period. I was just trying to find out. I thought it was due to the inactive shutdown code.
Thanks RoyVidar for pointing out the links.

Zameer Abdulla
[sub]Jack of Visual Basic Programming, Master in Dining & Sleeping[/sub]
Visit Me
 
Yeah I have suggested the link to the person who send the db to me.

Zameer Abdulla
[sub]Jack of Visual Basic Programming, Master in Dining & Sleeping[/sub]
Visit Me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top