|
| |

VB.NET - Ein- und Umsteiger| Re: 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.671 | cgiesen | 19.08.09 12:51 |   Re: Forms und Custom Controls, seltsames verhalten | 1.025 | FZelle | 20.08.09 14:31 |   Re: Forms und Custom Controls, seltsames verhalten | 996 | cgiesen | 20.08.09 17:52 |   Re: Forms und Custom Controls, seltsames verhalten | 973 | cgiesen | 20.08.09 19:30 |    Re: Forms und Custom Controls, seltsames verhalten | 1.023 | DaveS | 20.08.09 19:42 |   Re: Forms und Custom Controls, seltsames verhalten | 1.028 | cgiesen | 20.08.09 19:49 |    Re: Forms und Custom Controls, seltsames verhalten | 995 | DaveS | 20.08.09 19:55 |    Re: Forms und Custom Controls, seltsames verhalten | 936 | cgiesen | 20.08.09 20:04 |   Re: Forms und Custom Controls, seltsames verhalten | 1.004 | cgiesen | 20.08.09 20:08 |   Re: Forms und Custom Controls, seltsames verhalten | 1.026 | cgiesen | 20.08.09 23:05 |   Re: Forms und Custom Controls, seltsames verhalten | 988 | cgiesen | 21.08.09 00:32 |    Re: Forms und Custom Controls, seltsames verhalten | 971 | DaveS | 21.08.09 09:01 |     Re: Forms und Custom Controls, seltsames verhalten | 957 | cgiesen | 21.08.09 09:53 |      Re: Forms und Custom Controls, seltsames verhalten | 1.035 | xtts02 | 21.08.09 10:05 |   Re: Forms und Custom Controls, seltsames verhalten | 952 | cgiesen | 21.08.09 11:08 |   Re: Forms und Custom Controls, seltsames verhalten | 970 | cgiesen | 21.08.09 11:09 |   Re: Forms und Custom Controls, seltsames verhalten | 1.077 | cgiesen | 21.08.09 11:10 |   Re: Forms und Custom Controls, seltsames verhalten | 943 | cgiesen | 21.08.09 12:51 |    Re: Forms und Custom Controls, seltsames verhalten | 967 | DaveS | 21.08.09 13:40 |     Re: Forms und Custom Controls, seltsames verhalten | 1.086 | cgiesen | 21.08.09 14:17 |      Re: Forms und Custom Controls, seltsames verhalten | 938 | 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 |
  |
|
vb@rchiv CD Vol.6 vb@rchiv Vol.6
Geballtes Wissen aus mehr als 8 Jahren vb@rchiv!
Online-Update-Funktion Entwickler-Vollversionen u.v.m.Jetzt zugreifen Tipp des Monats sevGraph (VB/VBA) 
Grafische Auswertungen
Präsentieren Sie Ihre Daten mit wenig Aufwand in grafischer Form. sevGraph unterstützt hierbei Balken-, Linien- und Stapel-Diagramme (Stacked Bars), sowie 2D- und 3D-Tortendiagramme und arbeitet vollständig datenbankunabhängig! Weitere 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
|
|