Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ToolStripProgressBar1.Value = 0
ToolStripStatusLabel1.Text = "작업을 완료하는중...기다려 주세요..."
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
ToolStripProgressBar1.Value += 2
If ToolStripProgressBar1.Value = 100 Then
ToolStripStatusLabel1.Text = "작업을 완료하였습니다"
Timer1.Enabled = False
End If
End Sub
End Class
* StatusStrip는 보고있는 개체, 개체의 구성 요소, 또는 개체의 작업에 대한 정보를 사용자에게 표시한다
오른쪽에 날짜와 시간 추가 ( 옵션의 Spring -> True 변경하여 남은 공간의 여백 채움 설정 )
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick ToolStripStatusLabel2.Text = Format(Now, "yyyy/MM/dd") ToolStripStatusLabel3.Text = Format(TimeOfDay, "hh:mm:ss") End Sub
Public Class Form1 Dim WithEvents Time As New Timer Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Time.Start() ToolStripStatusLabel2.Text = Date.Today End Sub
Private Sub Time_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Time.Tick ToolStripStatusLabel3.Text = TimeOfDay End Sub
오른쪽에 날짜와 시간 추가 ( 옵션의 Spring -> True 변경하여 남은 공간의 여백 채움 설정 )
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
ToolStripStatusLabel2.Text = Format(Now, "yyyy/MM/dd")
ToolStripStatusLabel3.Text = Format(TimeOfDay, "hh:mm:ss")
End Sub
이 댓글을
Timer를 재정의해서 현재 날짜 시간을 표시-WithEvents 사용
Public Class Form1
Dim WithEvents Time As New Timer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Time.Start()
ToolStripStatusLabel2.Text = Date.Today
End Sub
Private Sub Time_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Time.Tick
ToolStripStatusLabel3.Text = TimeOfDay
End Sub
이 댓글을