| |

VB.NET - Ein- und UmsteigerRe: Forms und Custom Controls, seltsames verhalten | |  | Autor: cgiesen | Datum: 21.08.09 11:09 |
| Fortsetzung
Private myBackColor As System.Drawing.Color = Color.Transparent
Public Overrides Property BackColor() As System.Drawing.Color
Get
Return MyBase.BackColor
End Get
Set(ByVal value As System.Drawing.Color)
MyBase.BackColor = value
myBackColor = value
myLabel.BackColor = myBackColor
End Set
End Property
Public Overridable Property DataSource() As Object
Get
Return myComboBox.DataSource
End Get
Set(ByVal value As Object)
myComboBox.DataSource = value
myLabel.Text = ""
End Set
End Property
Public Overridable Property ValueMember() As String
Get
Return myComboBox.ValueMember
End Get
Set(ByVal value As String)
myComboBox.ValueMember = value
End Set
End Property
Public Overridable Property DisplayMember() As String
Get
Return myComboBox.DisplayMember
End Get
Set(ByVal value As String)
myComboBox.DisplayMember = value
End Set
End Property
Public Overridable Property SelectedValue() As Object
Get
Return myComboBox.SelectedValue
End Get
Set(ByVal value As Object)
If IsNothing(value) = False Then
myComboBox.SelectedValue = value
If value < 1 Then
myLabel.Text = myNoSelection
Else
If IsNothing(myComboBox.SelectedValue) = False Then
myLabel.Text = myComboBox.SelectedItem( _
myComboBox.DisplayMember)
Else
End If
End If
Else
myLabel.Text = myNoSelection
End If
End Set
End Property
Public ReadOnly Property Items() As ComboBox.ObjectCollection
Get
Return myComboBox.Items
End Get
End Property
Private myFont As System.Drawing.Font '= New Font("Verdana", 7, _
FontStyle.Regular)
Public Overrides Property font() As System.Drawing.Font
Get
Return myFont
End Get
Set(ByVal value As System.Drawing.Font)
myFont = value
myLabel.Font = myFont
myComboBox.Font = myFont
MyBase.Height = myComboBox.Height - 6
myLabel.Height = MyBase.Height
End Set
End Property
Private Sub myLabel_TextChanged(ByVal sender As Object, ByVal e As _
System.EventArgs) Handles myLabel.TextChanged
setLableBackColor()
End Sub
Private Sub setLableBackColor()
If isMandatory = True And myLabel.Text = myNoSelection Then
myHasError = 1
Else
myHasError = 0
End If
If myHasError > 0 Then
myLabel.BackColor = myErrorColor
Else
If isEditMode = True Then
myLabel.BackColor = myEditBackColor
Else
myLabel.BackColor = myBackColor
End If
End If
End Sub
Private myNoSelection As String = "- no selection -"
Public Property NoSelection() As String
Get
Return myNoSelection
End Get
Set(ByVal value As String)
myNoSelection = value
If myComboBox.SelectedValue = Nothing Then
myLabel.Text = myNoSelection
End If
End Set
End Property
End Class |  |
 Forms und Custom Controls, seltsames verhalten | 1.655 | cgiesen | 19.08.09 12:51 |   Re: Forms und Custom Controls, seltsames verhalten | 1.017 | FZelle | 20.08.09 14:31 |   Re: Forms und Custom Controls, seltsames verhalten | 975 | cgiesen | 20.08.09 17:52 |   Re: Forms und Custom Controls, seltsames verhalten | 964 | cgiesen | 20.08.09 19:30 |    Re: Forms und Custom Controls, seltsames verhalten | 1.016 | DaveS | 20.08.09 19:42 |   Re: Forms und Custom Controls, seltsames verhalten | 1.017 | cgiesen | 20.08.09 19:49 |    Re: Forms und Custom Controls, seltsames verhalten | 982 | DaveS | 20.08.09 19:55 |    Re: Forms und Custom Controls, seltsames verhalten | 929 | cgiesen | 20.08.09 20:04 |   Re: Forms und Custom Controls, seltsames verhalten | 997 | cgiesen | 20.08.09 20:08 |   Re: Forms und Custom Controls, seltsames verhalten | 1.018 | cgiesen | 20.08.09 23:05 |   Re: Forms und Custom Controls, seltsames verhalten | 979 | cgiesen | 21.08.09 00:32 |    Re: Forms und Custom Controls, seltsames verhalten | 964 | DaveS | 21.08.09 09:01 |     Re: Forms und Custom Controls, seltsames verhalten | 949 | cgiesen | 21.08.09 09:53 |      Re: Forms und Custom Controls, seltsames verhalten | 1.026 | xtts02 | 21.08.09 10:05 |   Re: Forms und Custom Controls, seltsames verhalten | 942 | cgiesen | 21.08.09 11:08 |   Re: Forms und Custom Controls, seltsames verhalten | 959 | cgiesen | 21.08.09 11:09 |   Re: Forms und Custom Controls, seltsames verhalten | 1.067 | cgiesen | 21.08.09 11:10 |   Re: Forms und Custom Controls, seltsames verhalten | 935 | cgiesen | 21.08.09 12:51 |    Re: Forms und Custom Controls, seltsames verhalten | 959 | DaveS | 21.08.09 13:40 |     Re: Forms und Custom Controls, seltsames verhalten | 1.058 | cgiesen | 21.08.09 14:17 |      Re: Forms und Custom Controls, seltsames verhalten | 929 | DaveS | 21.08.09 15:51 |
 | Sie sind nicht angemeldet! Um auf diesen Beitrag zu antworten oder neue Beiträge schreiben zu können, müssen Sie sich zunächst anmelden.
Einloggen | Neu registrieren |
  |
|
Neu! sevCommand 4.0 
Professionelle Schaltflächen im modernen Design!
Mit nur wenigen Mausklicks statten auch Sie Ihre Anwendungen ab sofort mit grafischen Schaltflächen im modernen Look & Feel aus (WinXP, Office, Vista oder auch Windows 8), inkl. große Symbolbibliothek. Weitere InfosTipp des Monats Access-Tools Vol.1 
Über 400 MByte Inhalt
Mehr als 250 Access-Beispiele, 25 Add-Ins und ActiveX-Komponenten, 16 VB-Projekt inkl. Source, mehr als 320 Tipps & Tricks für Access und VB
Nur 24,95 EURWeitere Infos
|
|
|
Copyright ©2000-2025 vb@rchiv Dieter Otter Alle Rechte vorbehalten.
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein.
Diese Seiten wurden optimiert für eine Bildschirmauflösung von mind. 1280x1024 Pixel
|
|