Advertisement
Advertisement
| 04.07.2008 at 10:49AM PDT, ID: 23302146 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
|
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: |
Public Class mainForm
Public formInForm As Object
Public formLoadedInForm$
Public Sub New()
InitializeComponent()
OpenNewForm(formDataGrid)
End Sub
Public Sub OpenNewForm(ByVal sForm As System.Windows.Forms.Form)
'Me.SplitContainer1.Panel2.Controls().Clear()
formInForm = sForm
formLoadedInForm = sForm.Name.ToLower
With formInForm
.toplevel = False
Me.SplitContainer1.Panel2.Controls.Add(formInForm)
CenterInnerForm()
If .Visible = False Then sForm.Show() Else sForm.Focus()
End With
End Sub
'--> This calls the Routine in Question
Private Sub Main_ResizeEnd(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.ResizeEnd
If formLoadedInForm = "formdatagrid" Then
formInForm.Form2_Resize(sender, e)
End If
End Sub
Public Sub CenterInnerForm()
Dim myRect As System.Drawing.Rectangle
With formInForm
If formLoadedInForm <> "" Then
myRect = Me.SplitContainer1.Panel2.Bounds
.Left = (myRect.Width - .width) / 2 '(.Right - .Left)) / 2
.Top = (myRect.Height - (.Bottom - .Top)) / 2
End If
End With
End Sub
End Class
Public Class formDataGrid
'--> This is the Routine in Question
Public Sub Form2_Resize(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Resize
Dim frm As Form = Me 'Me.MdiParent
If frm Is Nothing Then Exit Sub
If sender.name = "mainForm" Then
Debug.Print(mainForm.SplitContainer1.Panel2.Width & ", " & mainForm.SplitContainer1.Panel2.Height)
'frm.FormBorderStyle = Windows.Forms.FormBorderStyle.Sizable
Me.Width = mainForm.SplitContainer1.Panel2.Width
Me.Height = mainForm.SplitContainer1.Panel2.Height
Debug.Print(Me.Width & ", " & Me.Height)
End If
If Me.WindowState = FormWindowState.Maximized Then
frm.FormBorderStyle = Windows.Forms.FormBorderStyle.None
End If
If Not Me.WindowState = FormWindowState.Minimized Then
Me.mydatagrid.Left = 0 '4
Me.mydatagrid.Top = 0 '4
Me.mydatagrid.Width = Me.Width ' - 10
Me.mydatagrid.Height = Me.Height - Me.BindingNavigator1.Height
End If
End Sub
End Class
|