|
-
Aug 30th, 2012, 10:46 AM
#1
Thread Starter
New Member
Resize the controls on windows form when the form is maximed or in normal state
In case of windows desktop vb.net application, All the controls on my form should scale/resize based on the size of the form when the form is maximized. I have a flow layout panel,multiple controls on this panel, a panel with report viewer (of .rdlc report(client not server side)) as one of the many controls on the form.Also, I need to revert back to the regular size of all these controls when the form is in normal state?Should I do in the form_resize event?
I tried as below:
Private Sub formMain_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
If Me.WindowState = "2" Then
ResizeFormToScreen(Me)
tabcntrl.Size = New Size(tabcntrl.Width * 0.4, tabcntrl.Height * 1.5)
flpcntrl.Size = New Size(flpcntrl.Width + 40, flpcntrl.Height + 100)
flpcntrl.Refresh()
ElseIf Me.WindowState = "1" Then
MessageBox.Show("Form minimized")
Me.SuspendLayout()
Else 'Normal state
Me.ResumeLayout()
pnlViewer.Size = New Size(981, 596)
pnlViewer.Refresh()
tcCntrl.Size = New Size(998, 602)
flpMain.Size = New Size(flpMain.Width - 40, flpMain.Height - 100)
EndIf
Please suggest.I appreciate your help.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|