tags:

views:

33

answers:

2

hi guys, I have this huge VB project which i just got from some one. i want to add a check box to a dialog in it so i opened Main2.frm and added a check box using ide. but now when i run the application the dialog resized to its orignal size hence not showing the new check box which is at the bottom. I know that this means somewhere in the code there might be something resizing the dialog box but i have scaned the code and found nothing. where the dialog is being created this is being done:

Main2.vsCodeOptions.Left = 10 Main2.vsCodeOptions.Top = 0

Main2.Move main.Left + (main.Width - Main2.Width) \ 2, main.Top + (main.Height - Main2.Height) \ 2, 3900, 5010
Main2.VSImport.Visible = False
Main2.VSAlload.Visible = False
Main2.VsrepPrt.Visible = False
Main2.VSAbout.Visible = False
Main2.vsCodeOptions.Visible = True

Main2.Left = main.Left + (main.Width - Main2.Width) \ 2
Main2.Top = main.Top + (main.Height - Main2.Height) \ 2
'Use this code to make the form stay on top in the form module:
SetWindowPos Main2.hWnd, HWND_TOPMOST, Main2.Left, Main2.Top, 0, 0, SWP_NOMOVE + SWP_NOSIZE

one more thing i am new to VB and VB editor. i want to all controls in a dialog to move collectively, one method is to select them one by one but i want to select all and then move them to make room for new dialog –

thanks

A: 

The first line of your code snippet - doesn't it set the size of Main2? To 3900 x 5010? And then a few lines later you move the form again (to exactly where it is) for no good reason.

I'm a little thrown off by all the \ - should they be / ? Did you type this or paste this?

Kate Gregory
Kate you are right, my bad
jaminator
one more thing i am new to VB and VB editor. i want to all controls in a dialog to move collectively, one method is to select them one by one but i want to select all and then move them to make room for new dialog
jaminator
\ is the integer division operator in VB.
MarkJ
@jaminator hold down the control key and you can select multiple controls. I hope you are using version control!
MarkJ
thanks for the reply Mark but as i stated in my above comment "one more thing i am new to VB and VB editor. i want to all controls in a dialog to move collectively, one method is to select them one by one but i want to select all and then move them to make room for new dialog" I KNOW HOW TO SELECT CONTROLS ONE BY ONE I WAS LOOKING FOR A METHOD TO SELECT ALL AT ONCE
jaminator
In the IDE? just click-drag over the controls or ctrl+A, then ctrl+arrow to move neatly.
Alex K.
Thanks @MarkJ I've done plenty of VB and somehow never saw that before.
Kate Gregory
in the ide i want to undo changes but pressing ctrl z doesnt do anything. help needed
jaminator
A: 

Try to make the position of the control relative to the Top and Left properties of the form. This way it will always be at the same position no matter what the size of the form is.

Dia