Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Can you give a small example on Modal and Modeless dialog boxes using VB.NET forms ?

Posted on 2006-03-23
7
Medium Priority
?
352 Views
Last Modified: 2011-09-20


Please let me know with sample code:

1.Modal Dialog Box
2.Modeless Dialog Box

Thanks,
Kishore
0
Comment
Question by:kishore_peddi
7 Comments
 
LVL 21

Accepted Solution

by:
Yurich earned 600 total points
ID: 16277574
1. MessageBox.Show( "I'm a modal box" )

2. Modal
Dim form as New Form2
form.ShowDialog()

3. Modeless
Dim form as New Form2
form.Show()

MessageBox is always modal. Form2 - is a windows form in your aplication.

good luck,
yurich
0
 
LVL 9

Assisted Solution

by:Naveen Swamy
Naveen Swamy earned 450 total points
ID: 16278163
modal dialog boxes have parent and once opened, cannot return to parent without closing the child form

modeless are those which are loosley coupled form which could be having assigned parents

        Dim objFrm As New Form
        objFrm.ShowDialog() '******MODAL*********
        MessageBox.Show("goodknowhow", "modalbox", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) '******MODAL*********

        objFrm.Show() '******MODELESS*********

0
 

Assisted Solution

by:FadeDude
FadeDude earned 450 total points
ID: 16278957
Yes, in plain english.

If a form is opened as modeless, you can focus on other forms in you application while that on is open.
If it is opened "modal" , no other form can have focus until that form is closed. I.e the user cannot accidentily click on another part of your app and "loose" the form they were working on.

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 21

Expert Comment

by:Yurich
ID: 16279090
i'm just wondering how many more people will try to explain a difference between modal and modeless... No one so far tried plain Danish and it might be of help.
0
 

Expert Comment

by:FadeDude
ID: 16279124
Hmm, If you weren't such an expert..(checks out profile for yurich). I'd think of a "come-back".
:)
0
 

Author Comment

by:kishore_peddi
ID: 16280626

Guys,

Thanks a lot for your explanation and code examples.

Thanks,
Kishore
0
 
LVL 21

Expert Comment

by:Yurich
ID: 16284159
Jeees, why was it B??? what was possibly not enough???
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
Suggested Courses
Course of the Month12 days, 6 hours left to enroll

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question