Is it possible to automatically open gb.Form.Dialog full screen (i.e.maximized)? I know it is possible to click on the maximize button after the dialog is opened but this is an unnecessarily annoying extra step to get a better view of the directory structure when looking for a file. If it's not possible then I guess I'll just have to go with a file chooser on a maximized form.
bazzvn
Open gb.Form.Dialog maximised (full screen)
- cogier
- Site Admin
- Posts: 1125
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: Open gb.Form.Dialog maximised (full screen)
I have had a look at this, and I can't work out how to do this. Sorry.
Re: Open gb.Form.Dialog maximised (full screen)
I suggest some resources of the "DesktopWatcher " and "DesktopWindows " Classes by activating the gb.desktop and gb.desktop.x11 Components:
Private wa As DesktopWatcher
Private dw As DesktopWindow
Public Sub Form_Open()
' It watchs all windows, present and future, on the desktop:
wa = New DesktopWatcher As "DWatch"
End
Public Sub Button1_Click()
With Dialog
' The "title" of the Dialog window must be certain and unique:
.Title = "Abcde"
If .OpenFile() Then Return
End With
End
Public Sub DWatch_Windows() ' If the window list on the desktop has changed...
' ...then checks if the "Abcde" window has opened:
If Desktop.FindWindow("Abcde", Null, Null).Count > 0 Then
' If so, the Dialog window is resized:
With dw = New DesktopWindow(Desktop.FindWindow("Abcde", Null, Null)[0])
.Resize(Screen.AvailableWidth, Screen.AvailableHeight)
End With
Endif
End
Europaeus sum !
Amare memorentes atque deflentes ad mortem silenter labimur.
Amare memorentes atque deflentes ad mortem silenter labimur.
Re: Open gb.Form.Dialog maximised (full screen)
Don't know if this helps, but you can make Controls expand when the mouse enters the control.
As an example, open a new project and add a Splitter, put a DirChooser inside on the left and a TextArea inside on the right.
Public Sub Form_Open()
Splitter1.Layout = [5, 95]
Splitter1.Expand = True
TextArea1.Text = "Blah, blah, blah, blah.........................................."
End
Public Sub DirChooser1_Enter()
Splitter1.Layout = [95, 5]
End
Public Sub DirChooser1_Leave()
Splitter1.Layout = [5, 95]
End
When the mouse enters the DirChooser, it is expanded to [almost] the full size of the form.Re: Open gb.Form.Dialog maximised (full screen)
Thank you all, especially Vuott. Your code works wonderfully.
The only thing I had to add was 1 line of code after resizing, to reposition the form:
.Resize(Screen.AvailableWidth, Screen.AvailableHeight)
.Move(0,0) 'Move the dialog
With best wishes,
bazzvn
The only thing I had to add was 1 line of code after resizing, to reposition the form:
Code: Select all
.Move(0,0) 'Move the dialog
With best wishes,
bazzvn