|
Tipp 0241
|
Farbige Command-Buttons - 2 -
|
|
|
Autor/Einsender: Datum: |
|
Angie 27.05.2002 |
|
Entwicklungsumgebung: |
|
VB 5 |
|
|
Mit einem CommandButton, dessen Style-Eigenschaft zur Entwurfszeit auf 1 - Grafisch gesetzt wurde,
und einer PictureBox kann man durchaus auch farbige CommandButtons erstellen, sowohl mit farbiger
Schrift als auch farbigem Hintergrund. Zur Laufzeit wird die Beschriftung für den CommandButton mit der Print-Methode
zur PictureBox hinzugefügt und die Grafik dann dem CommandButton zugewiesen.
|
Fügt man zur PictureBox eine entsprechende Grafik hinzu, kann diese Grafik, im Gegensatz zu unserem Tipp
Farbige Command-Buttons - 1 -, beispielsweise auch links ausgerichtet sein, und nicht nur oberhalb des Captions.
Ob die Grafik links, rechts oder in der Mitte erscheinen soll, hängt von der der PictureBox zugewiesenen Grafik ab, man kann
also seiner Phantasie freien Lauf lassen.
|
|
|
Option Explicit
Private Sub Form_Load()
With Picture1
.Visible = False
.AutoRedraw = True
.ForeColor = vbBlue
.FontBold = True
End With
Picture1.CurrentX = Command1.Width / 2.5
Picture1.CurrentY = Command1.Height / 3
Picture1.Print "Beenden"
Command1.Caption = ""
Command1.Picture = Picture1.Image
End Sub
|
|
|
|
|
Windows-Version |
95 |
|
|
98/SE |
|
|
ME |
|
|
NT |
|
|
2000 |
|
|
XP |
|
|
Vista |
|
|
Win
7 |
|
|
|
VB-Version |
VBA 5 |
|
|
VBA 6 |
|
|
VB 4/16 |
|
|
VB 4/32 |
|
|
VB 5 |
|
|
VB 6 |
|
|
|
|
Download (3,1 kB)
|
Downloads bisher: [ 1657 ]
|
|
|