Form object resizing
Hi there everyone,
Something is baffling me here. I'm trying to code a resize event to ensure correct placement of my controls whenever the form is resized. I have a picturebox control that I wish to fill the screen but leaving a gap, of around 3, either side. At the bottom of the form I have a textbox control (txtCallsign) that I intend to keep fixed to the bottom of the form. I've tried the following code:
Sub frmMain_Resize(ByVal senderAsObject,ByVal eAs System.EventArgs)HandlesMe.ResizePrivate
' Resize the picture box control as the form
' resizes.
PictureBox1.Left = 3
PictureBox1.Top = MenuStrip.Height + 1
PictureBox1.Width =Me.Width - 6
PictureBox1.Height = (Me.Height - 4) - txtCallsign.Height
EndSub
For some strange reason the picture box control seems to go off the screen to the right and is also off the screen to the bottom, completely blanking the text box out.
Any ideas because it's baffled me. I've managed to get it sized correctly on the right but only after using this line:
PictureBox1.Width =Me.Width - 14
I have no idea where the 14 has come from? Seems like quite a strange random number to me.
Thanks in advance,
Ady

