-
Hi there,
:confused: got another problem ...
I have an MDI application
on the left side of the MDI-Form I placed a picturebox.
I added a TreeView to it, to display items(records) for navigation
Now, what I what is to resize that TreeView in the MDIForm_Resize Event so that the TreeView is always 80% the height of the picture box
Well, making the form larger or smaller isn't the problem - there it works. However when I maximize the form it doesn't.
I added a few debug.print to the code to get the size of the MDIform and the PictureBox after maximizing:
After the form was maximized the PictureBox still had the height it had before, when I minimized the form to normal again, the PictureBox had now the height it should actually have when the form was maximized ...
Would appreciate any tips ...
:) Thanx :)
Nina
(Germany)
Code:
Option Explicit
Public KategorienRS As New ADODB.Recordset
Dim nodX As Node
Private Sub MDIForm_Load()
SetTVBackColour &HC0C0C0 'Set Backcolor Treeview
TV1.Top = 0
TV1.Height = 0.8 * Picture1.Height
Kategorien_Anzeigen 'Shows Items in Treeview
End Sub
Private Sub MDIForm_Resize()
TV1.Top = 0
TV1.Height = 0.8 * Picture1.Height
End Sub
'etc.
[Edited by Nina on 03-23-2000 at 08:11 AM]
-
Re: Resize
In the resize event of the mdi form use the following
form1.height = me.height * .8
this will always keep the form at 80% of the height
-
Well, as you can see from the code I added, that's about what I did ...
But the code doesn't work when the form is maximized
-
The problem is that the Resize event is fired before the picture box is resized within the MDI form.
The solution is to use the ScaleHeight property of the MDI form instead of the height property of the picture box.
Code:
Private Sub MDIForm_Resize()
TV1.Top = 0
TV1.Height = 0.8 * Me.ScaleHeight
End Sub
Good luck!
-
Thanx a lot for your help ...