TextLabelクラス ForeColorプロパティ
表示するラベルの前景色(文字色)を設定または取得します。
使用法
Dim instance As TextLabel
Dim value As System.Drawing.Color
Dim returnValue As System.Drawing.Color
instance.ForeColor = value
returnValue = instance.ForeColor
使用例
'TextLabelクラス ForeColorプロパティ
Public Class AddIn
Private std As Std
Private stdf As StdFunc
Private tl As TextLabel
Public Sub New()
std = New Std()
stdf = New StdFunc()
tl = New TextLabel(std.Owner)
End Sub
Public Sub AddIn_Start()
tl.Text = "このラベル(フォーム)は移動できます"
tl.Padding = New System.Windows.Forms.Padding(5, 10, 20, 30) '左 上 右 下
tl.X = 500
tl.Y = 100
tl.BackColor = System.Drawing.Color.Red
tl.ForeColor = System.Drawing.Color.White
tl.Show()
For i As Integer = 0 To 5 Step 1
stdf.WaitMilliSec(500)
tl.BackColor = System.Drawing.Color.Blue
stdf.WaitMilliSec(500)
tl.BackColor = System.Drawing.Color.Red
Next
End Sub
Public Sub AddIn_Stop()
tl.Hide()
End Sub
End Class
'TextLabelクラス ForeColorプロパティ
Public Class AddIn
Private std As Std
Private stdf As StdFunc
Private tl As TextLabel
Public Sub New()
std = New Std()
stdf = New StdFunc()
tl = New TextLabel(std.Owner)
End Sub
Public Sub AddIn_Start()
tl = New TextLabel(std.Owner)
tl.Text = "このラベル(フォーム)は移動できます"
tl.Padding = New System.Windows.Forms.Padding(5, 10, 20, 30) '左 上 右 下
tl.X = 500
tl.Y = 100
tl.BackColor = System.Drawing.Color.Red
tl.ForeColor = System.Drawing.Color.White
tl.Show()
For i As Integer = 0 To 5 Step 1
stdf.WaitMilliSec(500)
If std.StopFlag Then Exit For
tl.BackColor = System.Drawing.Color.Blue
stdf.WaitMilliSec(500)
If std.StopFlag Then Exit For
tl.BackColor = System.Drawing.Color.Red
Next
End Sub
Public Sub AddIn_Stop()
'この時点でStd.StopFlagはTrueにセットされています。
'Disposeを行なった後にインスタンスにアクセスしない様
'Std.StopFlagを見て適切に処理を抜ける必要があります
tl.Dispose()
End Sub
End Class