J
Janez
Hi,
I have main form with listview on it and context menu with many menu
items is attached to this listview. In these menu items I create new
form (always the same form), set position properties of the controls
and visibility (depends on the menu item clicked) and display form
(ShowDialog). So position of the controls, height of the form and
visibility of the appropriate groupbox are determined at run time.
For example
Private Sub menu1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles menu1.Click
frm2 = New Form2
try
With frm2
.Height = 430
.button1.Top = 380
.button2.Top = 380
'here fill some listbox and comboboxes with data
......
.Text = "Something"
.Groupbox1.Visible = True
.ShowDialog()
End With
Finally
frm2.Dispose()
End Try
End Sub
However, I have noticed that when I run my application on Windows XP
with XP Style apperance, my buttons which are at the bottom of the
screen are hidden below the bottom of the form. They are not
completely gone, but some portion of them is hidden. I also noticed
that this only happens when I change Height of the form at run time.
If for example, I change height of the form at the design time to 430
and comment out the height property in the code, everything is
displayed as should. However, I need to change the height of the form
at run time.
How could I avoid this?
I have main form with listview on it and context menu with many menu
items is attached to this listview. In these menu items I create new
form (always the same form), set position properties of the controls
and visibility (depends on the menu item clicked) and display form
(ShowDialog). So position of the controls, height of the form and
visibility of the appropriate groupbox are determined at run time.
For example
Private Sub menu1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles menu1.Click
frm2 = New Form2
try
With frm2
.Height = 430
.button1.Top = 380
.button2.Top = 380
'here fill some listbox and comboboxes with data
......
.Text = "Something"
.Groupbox1.Visible = True
.ShowDialog()
End With
Finally
frm2.Dispose()
End Try
End Sub
However, I have noticed that when I run my application on Windows XP
with XP Style apperance, my buttons which are at the bottom of the
screen are hidden below the bottom of the form. They are not
completely gone, but some portion of them is hidden. I also noticed
that this only happens when I change Height of the form at run time.
If for example, I change height of the form at the design time to 430
and comment out the height property in the code, everything is
displayed as should. However, I need to change the height of the form
at run time.
How could I avoid this?