hi
when I double click on my MDIForm heading it minimizes.. how can I set its default place on the screen after minimizing.
any help?
thx in advance ..
Printable View
hi
when I double click on my MDIForm heading it minimizes.. how can I set its default place on the screen after minimizing.
any help?
thx in advance ..
Hmmm... DblClick maximizes the form... :confused:Quote:
Originally Posted by muhannad
When form is minimized it will either be shown in the taskbar (if ShowInTaskbar is set to true) OR (if it's a mdi child) it will appear in bottom left area of the MDI parent form and position is determined by the parent form itself.Quote:
Originally Posted by muhannad
By default VB will generate an error "Form cannot be moved while minimized..." (or so). You may subclass the form but it's pointless.
You can try doing something like this quick sample for any of your MDI Child forms but user will have a headach to restore it to the original size/position:
VB Code:
Private Sub Form_Resize() If Me.WindowState = vbMinimized Then Me.WindowState = vbNormal Me.Move 0, 0, 0, 0 End If End Sub
Would this help?Quote:
Originally Posted by muhannad
Of course, the .Tag property musn't be used for anything else in this case.VB Code:
Option Explicit Private Sub Form_Load() With Me .Tag = .Left & ";" & .Top & ";" & .Width & ";" & .Height End With End Sub Private Sub Form_Resize() If Me.WindowState = vbMinimized Then With Me .WindowState = vbNormal .Move CSng(Split(.Tag, ";")(0)), CSng(Split(.Tag, ";")(1)), CSng(Split(.Tag, ";")(2)), CSng(Split(.Tag, ";")(3)) End With End If End Sub
ooh sorry i didnt minimize as in it appears in the taskbar..
as my application runs, i set the MDIForm to be maximized by default ( full screen ).
when i double click its heading it resizes itself and becomes smaller and a big portion becomes not visible. i was enquering about that default position if that makes it any clearer.
thanx
You may need to set minimum Height/Width:
VB Code:
Option Explicit Dim iMinWidth As Integer Dim iMinHeight As Integer Private Sub MDIForm_Load() iMinWidth = 12000 iMinHeight = 8000 End Sub Private Sub MDIForm_Resize() If Me.WindowState = vbNormal Then If Me.Width < iMinWidth Then Me.Width = iMinWidth If Me.Height < iMinHeight Then Me.Height = iMinHeight End If End Sub