Modeless dialog, Visual Basic Programming

MODELESS DIALOG

The Dialog boxes are either modal or modeless. The modal dialog box should be closed (Unloaded or hidden) before you can continue the working with the rest of the application. For illustration, the dialog box is modal if it needs you to click OK or Cancel before you can switch to the other form or dialog box.

The About dialog box in the Visual Basic is modal.

Dialog boxes: That displays the significant messages which should always be modal - that is, the user should always be needed to close the dialog box or respond to its message before proceeding.

Modeless dialog: let you move the focus between the dialog box and the other form without having to close the dialog box. You can carry on working elsewhere in the present application while the dialog box is exhibited. The Modeless dialog boxes are rare. Through the Edit menu, the Find dialog box in the Visual Basic is an illustration of a modeless dialog box. The use the modeless dialog boxes to display the frequently used commands or information.

The steps shown below should be following to create a modeless dialog.

1. Build a SDI application.

2. Build a global variable m_dlg of the CDialog type. To generate a global variable click the class tabpage. Now choose the view class. Right click and select the add member variable.

3. Build a dialog resource using the resource editor.

To produce the dialog resource, click on the resource tabpage.

Expand the dialog resources.

Choose the dialog option.

Right Click it and select insert from the pop up menu.

Select the resource type as the dialog

Click new to create the new dialog (IDD_DIALOG1) given in the constructor.

4. Initialize the dialog resource in the view constructor which is as shown below:

CModalessView::CModalessView()

{

m_dlg.Create(IDD_DIALOG1,this);

}

The Create function in the constructor assign the dialog to the m_dlg CDialog object.

5. Handle the message WM_LBUTTONDBLCLK for the object id CModalessView and type the coding as shown beow in the handler.

void CModalessView::OnLButtonDblClk(UINT nFlags, CPoint point)

{

m_dlg.ShowWindow(SW_SHOW);

}

The Show Window is used for displaying the modeless dialog.

6. Construct and execute the project.

7. Whenever the left button is double clicked, then the window is displayed.

8. You can continue the working with the other windows.

9. The modeless dialog will minimize whenever you work with the other windows.

10. On clicking Alt + Tab key concurrently the modeless dialog is displayed.

Posted Date: 10/10/2012 2:12:26 AM | Location : United States







Related Discussions:- Modeless dialog, Assignment Help, Ask Question on Modeless dialog, Get Answer, Expert's Help, Modeless dialog Discussions

Write discussion on Modeless dialog
Your posts are moderated
Related Questions
USE OF SERIALIZE FUNCTION IN DOCUMENT CLASS TO IMPLEMENT FILE void CStoreDoc::Serialize(CArchive& ar) { if (ar.IsStoring()) { // TODO: add storing code here }

Objective: To develop an Application (Excel + VBA) that determines the optimal inventory policy under an All-Units Discount scheme. APPLICATION CHARACTERISTICS Consider the

MULTIPLE DOCUMENT INTERFACE (MDI) WINDOWS   The SDI (Single document interface) supports one open window or document at a particular time. Microsoft's notepad and paint are il

GENETICS 1.         The branch genetics started in 1900 after rediscovery of Mendel's work. 2.         Gregor Johann Mendel is called Father of genetics. 3.         The t

Adding Handlers With Class Wizard: Whenever a handler is added, the class wizard places the prototype for the message handler in the header (.H) file. It gives a skeleton hand

ToolTip: The ToolTip property is used to flash a message regarding a control object when the mouse pointer moves over that object for a couple of seconds. Pick a control and c

WINDOWS PROGRAMMING The Windows programming is a developing application using the C and the native Win32 application interface (API) or C++ and the class libraries like Microso

John''s gas supply is read from a 4-digit meter each month that shows the current total gas used in cubic meters. The amount of gas used that month is determined by subtracting t

Accelerators: The Accelerators are short cut keys. The Accelerators are formed by placing an ampersand before any of the characters of the Caption. As a product the letter fol

i need sample balance sheet form in vb.net