M
Martin Eyles
I am making a simple program that displays a warning message for 10 seconds
when a user attempts to run an unauthorised program. (I may also log to a
file, but I want the simple warning message working first).
I have made a windows form Form1 which contains a label Label1. In my code I
make an instance of Form1 called theForm, and use its Show method and
CenterToScreen method. I then wait 10 seconds, before the main method ends.
In the Form1 Load handler, I perform the show method of the Label.
In practice, the form is indeed shown and centered on screen. However, the
label is not drawn on screen, leaving a transparent area where whichever
program is running behind shows through.
The code for the methods I have written is:
Public Shared Sub main()
Dim theForm As New Form1
theForm.Show()
theForm.CenterToScreen()
Threading.Thread.Sleep(10 * 1000)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Label1.Show()
End Sub
Does anyone have any idea how to fix this?
Thanks,
Martin
when a user attempts to run an unauthorised program. (I may also log to a
file, but I want the simple warning message working first).
I have made a windows form Form1 which contains a label Label1. In my code I
make an instance of Form1 called theForm, and use its Show method and
CenterToScreen method. I then wait 10 seconds, before the main method ends.
In the Form1 Load handler, I perform the show method of the Label.
In practice, the form is indeed shown and centered on screen. However, the
label is not drawn on screen, leaving a transparent area where whichever
program is running behind shows through.
The code for the methods I have written is:
Public Shared Sub main()
Dim theForm As New Form1
theForm.Show()
theForm.CenterToScreen()
Threading.Thread.Sleep(10 * 1000)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Label1.Show()
End Sub
Does anyone have any idea how to fix this?
Thanks,
Martin