Home > Archive > MCSD > March 2002 > Message Box & Strings





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Message Box & Strings
TW2001

2002-03-16, 11:46 am

Hello everyone.I have a proably simple q for you guys.

Here is a message box of mine:

MsgBox totalMsg, vbOKOnly, Space$(100)

How can I increase the size vertically? Where do I add the Msgbox title now? If I tack it on the I get an error.


How do people feel about intializing variables with a Loadform method? Is it a good practice?

Any help would be appreciated.
cassie

2002-03-17, 3:14 am

Hi TW2001,

First of all, I assume that your "Space$(100)" in the title is to make the message box longer. You can do something similar to increase the size of it vertically, using Chr(13) (enter). Don't know a more elegant way.

You can easily add a title by concatenating it with your "Space$(100).

So you could try something like:

MsgBox totalmsg & Chr(13) & Chr(13) & Chr(13) & Chr(13) & Chr(13) & Chr(13), vbOKOnly, "mytitle" & Space$(100)

Cassie
TW2001

2002-03-17, 8:26 pm

Thanks Cassie.That was what I needed to know.
AndyC

2002-03-18, 7:21 am

I couldn't find that anywhere in my book......Hmm, need to get another one I think!
RichardJW

2002-03-18, 11:42 am

Space$(100) is for compatibility with older VB code. Use Space(100).

If you desire a lot of control you could create a custom message box with a standard form. Load it modally and then unload it out of memory when the desired action has been performed.

quote:
How do people feel about intializing variables with a Loadform method? Is it a good practice?


There is no LoadForm method in VB 6.0 but if you mean initialising variables in the Form_Load event then that practice is fine and standard. There are certain caveats with the Initialise event though usually you can initialise safely there as well.

If you mean using an API method, you will have no more flexibility than if you used the built in VB library.
AndyC

2002-03-18, 11:55 am

Wahey!...this is the type of post I like to see - cheers Richard!
TW2001

2002-03-18, 1:39 pm

Great!
Thanks Richard.

I meant Form_load (sorry about that sloppiness).Im still learining to use internal librarys so the functionality of an API is little over my head right now.

The standard Form idea for the MsgBox is an excellent one.

Thanks, Outputting summary display etc..will go a lot smoother that way.

Cheers!
hard_coder

2002-03-18, 8:47 pm

Modal - nuff said
Sponsored Links





Free Braindumps | MCSE braindumps software forum

Copyright 2003 - 2008 examnotes.net