in visual basic how do you pop up a child window that has control until they hit OK?

Noriaki

Lifer
Jun 3, 2000
13,640
1
71
in visual basic how do you pop up a child window that has control until they hit OK?

Okay...so I have no problems make a child dialog box pop up.

But I need it to have control until they hit OK....

Right now they can bring up the child box, and still play with the main form...I want to lock out the main form until they hit OK or cancel in the dialog box.

Is there a fucntion I can call that will Lock the form? And then another to unlock it...or....


Assume the main form is called fMain, and there is a Dialog box called fDialog with OK and Cancel buttons.
 

Noriaki

Lifer
Jun 3, 2000
13,640
1
71
ahh vbModal

lol I know the word Modal...but they just had to stick a vb in front of it ;-)

Thanks man.
 

BuckleDownBen

Banned
Jun 11, 2001
519
0
0
They stick vb in front of everything.

I don't know if you know this, but I'll mention it anyways. If you hit F2, you get to the object browser where you could have searched for modal.
 

Noriaki

Lifer
Jun 3, 2000
13,640
1
71
No...I know nothing about VB....

I've used Delphi, C-Builder, J-Builder, Forte, and Codewarrior (ick ick on the last 2) but never VB.

And my language proficiney oddly doesn't include Basic...heh.


I've managed to hammer out what I need. It's pretty intuitive mostly.

Thanks for the help on the vbModal.
 

Noriaki

Lifer
Jun 3, 2000
13,640
1
71


<< Noriaki: What's with all the VB coding with you recently? >>



Stuipd class I'm doing.
Software Engineering 310, Human Computer Interaction.

We don't do any really functional coding, but we have to make a GUI...

I'd rather use Delphi or even CBuilder...but everyone in the group has Visual Studio, and I'm the only one that has Delphi or CBuilder...and in Visual Studio I don't want to use C++ for a GUI only program.

So we ended up on Visual Basic. And I don't have a lot of experience in it, because my university is almost all Unix, so I do alot of Java and Swing.



Edit:


<< It's a great language. >>

Err...not really...It's a really bad language actually. But it has a good GUI building tool. However, IMO CBuilder and Delphi are every bit as good for that, with much better underlying programming languages, but very few people seem to know anything about Delphi or CBuilder. I guess because they aren't from Microsoft.
 

coder1

Senior member
Jul 29, 2000
433
0
0
Noriaki, well everyone is entitled to there opinion. It's one of the more popular langues for Enterprise development. I've used C++/MFC in the past for similiar development and it takes way to long to complete a given project. I've also played with Delphi, I think it's a great language as well. I've though about getting into more of Delphi, but the job market in the US is to small for that. Also I'm really enjoying VB.NET. Finally a full OOP language.
 

Noriaki

Lifer
Jun 3, 2000
13,640
1
71
Yes things do take to long in Visual C++ because it's not terribly good.

Try CBuilder, it's like Delphi, but it uses C++ rather than Object Pascal.


Never used the .NET version of VB, nor did I realize that it was fully object oriented.

At this point I find the language under VB to be rather restrictive. It's good for making GUIs, but I find that the language leaves some things to be desired.

Perhaps I'd be worth checking out VB.NET...



And I realize that Visual Basic is a popular enterprise language, but popular doesn't always equal good.

But don't get me wrong, I'm not trying to downplay the usefulness of VB. I just think the basic language is very restrictive. The UI development tools in VB are excellent.
 

coder1

Senior member
Jul 29, 2000
433
0
0
You do make a good point. VB does have it's downfalls. 95% of the time for me I don't use VB for GUI. I mostly use it just for the business logic. Usually a web interface is my GUI.
 

Noriaki

Lifer
Jun 3, 2000
13,640
1
71


<< I don't use languages other than VB. I was wondering where you found it restrictive? >>



It'd be kind of hard to explain. I've used about a half dozen different GUI development IDEs and programmed in about 10 languages (including Imperative (of the Object Oriented and Non-OO variety), Functional and Declarative).

With VB being your only language, it's kind of hard to give you a base of reference.

But my prefered form of programming is Object Oriented (mainly Java, but also C++, Effiel, and even Object Pascal)...and for me trying to program without Objects....well it's like telling a C hacker he can't use pointers anymore....

Thus if I have 10 elements of my program that do very similar things, but with small differences, I make a parent class with the base functionality and 10 sub classes that inherit that functionality and write the small differencese into the sub classes.

Cutting and pasting the code into 10 places is very unappealing to me, it means that if I have a logic error there, I have to change it in 10 places, not 1 (which is not only annoying, but can lead to further errors). I hate duplicated code. I always use inheriting classes or interfaces to implement shared functionality. That's just one example...and not even a terribly important one.

Things like polymorphism is where Objects really start to become useful.

It's just how I personally reason about problems. Everyone has their own way of it. And you are always biased towards one style (and in many cases, one specific language).

However, if VB.net is truly fully OO I'm very interested in it....