Library code snippets
Changing the look of command button
By Abdul, published on 14 Jul 2001
Changing the look of command button
This code will change the font of the command button to bold when the mouse moves over it and it will become default when the mouse moves out. You can change anything for command button or any other GUI control.
---------------------------------
Put a commandbutton on the center of the form and put this code in:
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Command1.FontBold = True
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Command1.FontBold = False
End Sub
Related articles
Related discussion
-
Problem with migration to C# (CoCreateInstanceEx)
by LRollison (1 replies)
-
VB6 Problem Creating Shortcuts
by rb1177 (0 replies)
-
how can i open a file
by kyawswarhtun (0 replies)
-
how to save any one form what i want?
by blackguy (5 replies)
-
Build an MP3 Player
by soybees (4 replies)
Related podcasts
-
Christian Beauclair
14 mai 2008 (�mission #0074) ::.Christian Beauclair: Stratégies de migration VB6 vers .NET Nous discutons avec Christian Beauclair des stratégies de migration VB6 vers .NET. Entre autres, nous discutons comment utiliser le "VB 6 Code Advisor" et le "Interop Forms Toolkit" pour ajouter la puiss...
try this
create a array of the command button
Option Explicit
Private Sub Command1_Click(Index As Integer)
Select Case Index
Case 0
MsgBox "Button1"
Case 1
MsgBox "Button2"
Case 2
MsgBox "Button3"
End Select
End Sub
Private Sub Command1_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
Command1(Index).FontBold = True
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim i As Integer
With Command1
For i = 0 To .Count - 1
.Item(i).FontBold = False
Next
End With
End Sub
I am a total noob 2 visual basic......so i was wonderin is there a way 2 get this piece of code 2 affect every single command button in a project???
This thread is for discussions of Changing the look of command button.