App main form size
I am trying to set the size of the initial form. The following code doesn't work, the size is always 793, 1068 (don't know where this came from). groupbox4 is made invisible so I know the code is being run.
Private Sub MyControl_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyControl.Load MyControl.AutoSize = False MyControl.Width = 230 MyControl.Height = 800 groupBox4.Visible = False ' Initialization code goes here End Sub
0
Best Answer
-
Also, you may want try to "Reset Tools Layout" (View->Workspace->Tools) to restore layout for all panels. This fill help if app shows up big/small.
Nikita.0
Answers
I believe I was able to duplicate the issue that you have asked about.
I put your
STATEMENTS into one of my projects.
These STATEMENTS did not seem to control the size of the dialog box when it was DOCKED or UNDOCKED.
I also put
into a PUBLIC SUBROUTINE that I could trigger manually to check the values in MYCONTROL.WIDTH and MYCONTROL.HEIGHT any time I wanted.
The MYCONTROL.WIDTH and MYCONTROL.HEIGHT do not seem to be directly connected or updated continuously from APPLICATION FORM in the PREMIER APPLICATION.
I also tried
and was not successful.
I hope this information is helpful.
-- Matt
Even if I resize the window in 'designer' it always changes back to a large window when I run the app. I would be happy just to set it in design mode but I can't.
Can you provide SCREEN CAPTURES that illustrate the results you are getting and the results that you desire?
Thanks.
-- Matt
I agree with Matt, it would be helpful to see what you are trying. Just to clarify, I understand that you are creating a new form in the Project Workbench (not an App), can you share the code used to bring up the form? In my own testing the form size can be set using the designer. I then bring it up using this code and the form uses the dimensions set in the designer:
Sub TestForm Dim f As New Form1 f.Form.Show End Sub
PierrePublic Sub New() MyControl.Width = 220 End Sub
The issue, you cannot use "New" in the compiled mode.Thanks,
Nikita.
In this example groupBox4.Visible = False works but changing the form size does not.
Perhaps it is easier just to pose the question - 'how do I set the size of the app form when it is started?'
Thanks for your help.