I morphed a vb6 app into .NET.
That app used to initialize the size of the form into values that made sense in twips, but not now.
Those same values (like 10,000 instead of maybe 1,000) make the app fill up all the available space on a 2 monitor display.
I would like to interogate some system setting and ask, "What is the width and height of the primary display? Something whose value would change based on whether the display dimenions were 1600 x 1200 or ?x?
Then I can change what used to be hardcoded values belowinto something that makes sense; Thanks! Greg
Call GetPrivateProfileString("App", "Width", "1000", s_ReturnValue, 255, INI_Filename)
Me.Width = CInt(s_ReturnValue.ToString)
Call GetPrivateProfileString("App", "Height", "800", s_ReturnValue, 255, INI_Filename)
Me.Height = CInt(s_ReturnValue.ToString)
Call GetPrivateProfileString("App", "WindowState", CStr(vbNormal), s_ReturnValue, 255, INI_Filename)
Select Case CInt(s_ReturnValue.ToString)
Case 0
Me.WindowState = System.Windows.Forms.FormWindowState.Normal
Case 1
Me.WindowState = System.Windows.Forms.FormWindowState.Minimized
Case 2
Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
End Select