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
このページのQRコード
便利ウェブサイト
便利 Steam アプリ
便利 Android アプリ