TALSOFT
Active member
- Joined
- Feb 23, 2012
- Messages
- 34
- Programming Experience
- 5-10
So I want this picture box to grow when the user clicks on it, to the size of the screen. Because at first it appears to be a button, when clicked it grows the size of lets just say Form1 (which is full screen, and for the sake of conversation lets say 1024 X 768 for simplicity).
Here is the code I have written (whereas SimpleShellMenu is the picturebox and logoutmenu is a timer set to 10ms
Private Sub logoutmenu_Tick(sender As Object, e As EventArgs) Handles logoutmenu.Tick
Dim YMG As Integer = SimpleShellMenu.Size.Width
Dim XMG As Integer = SimpleShellMenu.Size.Height
If XMG < Me.Size.Width Then
With SimpleShellMenu
.SizeMode = PictureBoxSizeMode.StretchImage
.Size = New Size(XMG, YMG)
XMG += 16
End With
End If
If YMG < Me.Size.Height Then
With SimpleShellMenu
.SizeMode = PictureBoxSizeMode.StretchImage
.Size = New Size(XMG, YMG)
YMG += 9
End With
End If
End Sub
What ends up happening is when I click the picturebox the timer starts, performing this simple math it appears to work at first but then it stops growing on the Width and starts jumping width wize its kind of creepy. Regardless it works for the most part, just does not fill the screen on the Width.
Any ideas what I am doing wrong?
Here is the code I have written (whereas SimpleShellMenu is the picturebox and logoutmenu is a timer set to 10ms
Private Sub logoutmenu_Tick(sender As Object, e As EventArgs) Handles logoutmenu.Tick
Dim YMG As Integer = SimpleShellMenu.Size.Width
Dim XMG As Integer = SimpleShellMenu.Size.Height
If XMG < Me.Size.Width Then
With SimpleShellMenu
.SizeMode = PictureBoxSizeMode.StretchImage
.Size = New Size(XMG, YMG)
XMG += 16
End With
End If
If YMG < Me.Size.Height Then
With SimpleShellMenu
.SizeMode = PictureBoxSizeMode.StretchImage
.Size = New Size(XMG, YMG)
YMG += 9
End With
End If
End Sub
What ends up happening is when I click the picturebox the timer starts, performing this simple math it appears to work at first but then it stops growing on the Width and starts jumping width wize its kind of creepy. Regardless it works for the most part, just does not fill the screen on the Width.
Any ideas what I am doing wrong?