English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I am writing a program in Visual Basic 6, and I would like to open a dialog box through a menu option. What code would do this for me (the form I want to open is called frmAbout)

2007-06-17 13:20:12 · 3 answers · asked by Anonymous in Computers & Internet Programming & Design

3 answers

VB6 uses the commonDialog control which is used to display dialog boxes for Colors, Fonts, Opening Files, Saving Files, Help and printer selection

You will need to add the component (ctrl+T) to your project by checking Microsoft Common Dialog 6.0 (SP3), Then you add this control object to your form. This control isnot displayed until one of its show methods is activated.

You can call these methods from any event handler (button or menu) or function.


If you want to open one of your other forms in your project then you can create a new instance of the form assigned to a variable and call a show method

Dim myFrm as New frmAbout

myFrm.show

You can use vbModal in the method to open the form modally

myFrm.Show(vbModal,Me) ' me is defined as the owner of the modal form

2007-06-17 13:44:54 · answer #1 · answered by MarkG 7 · 2 1

Mark (answer 1) is absolutely correct as usual. But I read the question differently. Though you mentioned a 'dialog box' I think you're just talking about opening a form, rather than opening a method of changing fonts, colors, etc.

If that's true, then simply create your menu. Assume your menu contains a listing for "About". In the code for mnuAbout, simply put:
frmAbout.show

You can add the Modal/modeless setting as Mark described depending on if you want to force closing of the About form before the user does anything else.

frmAbout.hide or frmAbout.Unload will get rid of the form

2007-06-17 14:00:43 · answer #2 · answered by rod 6 · 2 1

Log-in ID I am assuming you are meaning, it is not exactly clear what you are asking. But if it is on the load event for your application have it trigger and load a dialog to prompt the user for their log-in and password, this will return those values to your main application for verification. You will have to code these yourself. Including the look up in whatever database of password reference system you define yourself.

2016-05-18 01:47:31 · answer #3 · answered by ? 3 · 0 0

fedest.com, questions and answers