Jump to content



Welcome to KnowledgeSutra - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!
- - - - -

Msgbox


19 replies to this topic

#11 Inspiron

    Trap Grand Marshal Member

  • Kontributors
  • PipPipPipPipPipPipPipPipPipPipPip
  • 1,204 posts

Posted 17 November 2005 - 08:07 AM

Hmmm... He's talking about the types of Messagebox in VB.NET or VB.
Probably many doesn't understand what the code does...
Let me explain them with screenshots..

Normal Message Boxes
Windows.Forms.MessageBox.Show("This is a plain messagebox.")
Is shown as Posted Image

Windows.Forms.MessageBox.Show("This is a plain messagebox." & vbCrLf & "It's got a caption too.", "This is the caption.")
Is shown as Posted Image
----------------------------------------------------------------------------------------------

Message Boxes with Different Button Types
Windows.Forms.MessageBox.Show("It's got Abort, Retry, Cancel buttons.", "", MessageBoxButtons.AbortRetryIgnore)
Is shown as Posted Image

Windows.Forms.MessageBox.Show("It's got OK button.", "", MessageBoxButtons.OK)
Is shown as Posted Image

Windows.Forms.MessageBox.Show("It's got OK, Cancel buttons.", "", MessageBoxButtons.OKCancel)
Is shown as Posted Image

Windows.Forms.MessageBox.Show("It's got Retry, Cancel buttons.", "", MessageBoxButtons.RetryCancel)
Is shown as Posted Image

Windows.Forms.MessageBox.Show("It's got Yes, No buttons.", "", MessageBoxButtons.YesNo)
Is shown as Posted Image

Windows.Forms.MessageBox.Show("It's got Yes, No, Cancel buttons.", "", MessageBoxButtons.YesNoCancel)
Is shown as Posted Image
----------------------------------------------------------------------------------------------

Message Boxes with Different Alert Types
Windows.Forms.MessageBox.Show("An Asterisk type icon.", "", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
Is shown as Posted Image

Windows.Forms.MessageBox.Show("An Error type icon.", "", MessageBoxButtons.OK, MessageBoxIcon.Error)
Is shown as Posted Image

Windows.Forms.MessageBox.Show("An Exclamation type icon.", "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
Is shown as Posted Image

Windows.Forms.MessageBox.Show("A Hand type icon.", "", MessageBoxButtons.OK, MessageBoxIcon.Hand)
Is shown as Posted Image

Windows.Forms.MessageBox.Show("An Information type icon.", "", MessageBoxButtons.OK, MessageBoxIcon.Information)
Is shown as Posted Image

Windows.Forms.MessageBox.Show("A None type icon.", "", MessageBoxButtons.OK, MessageBoxIcon.None)
Is shown as Posted Image

Windows.Forms.MessageBox.Show("A Question type icon.", "", MessageBoxButtons.OK, MessageBoxIcon.Question)
Is shown as Posted Image

Windows.Forms.MessageBox.Show("A Stop type icon.", "", MessageBoxButtons.OK, MessageBoxIcon.Stop)
Is shown as Posted Image

Windows.Forms.MessageBox.Show("A Warning type icon.", "", MessageBoxButtons.OK, MessageBoxIcon.Warning)
Is shown as Posted Image

I've created an example on VB.NET 2003.
You can download the program here to view all the types of Messageboxes.
Download: http://www.freeuploa...w.php/69424.zip
Source Codes: http://www.freeuploa...w.php/69426.zip

#12 sharpz

    Member [Level 1]

  • Kontributors
  • PipPipPipPip
  • 67 posts

Posted 17 November 2005 - 08:24 AM

yes, the windows.forms.messagebox.show is also a wrapper for the MessageBoxA API call i beleive. it is basically the same as Visual Basic 6.0's MsgBox function, just a slightly different syntax. I never bothered with vb.net because c++ is just still alot better for directly accessing memory... however, if managed code becomes the new standard, i guess i would do .net
btw, MessageBoxButtons.OK and etc. are just constants representing hex code that is defined in some windows header that is included when you compile.

#13 markcqm

    Newbie [Level 1]

  • Kontributors
  • Pip
  • 22 posts

Posted 19 November 2005 - 01:44 PM

Could we change buttom "YES","NO","CANCEL" to other caption?

#14 Inspiron

    Trap Grand Marshal Member

  • Kontributors
  • PipPipPipPipPipPipPipPipPipPipPip
  • 1,204 posts

Posted 19 November 2005 - 02:29 PM

You can change the caption, or the title, of any messagebox. The only thing you cannot change is the text of the buttons in a messagebox.

However if you want to have a customised button text, you can make another form that opens as a dialog, to imitate the effects of a messagebox. This way, not even you can customise the button text of the messagebox, you can also add background pictures, sound effects, colors, and even add a customised icon.

Basically just treat the form as a messagebox and customise it..

#15 Galahad

    Neurotical Squirrel

  • Kontributors
  • PipPipPipPipPipPipPipPipPip
  • 590 posts
  • Gender:Male
  • Location:Novi Sad, Vojvodina
  • Interests:Programming, Hardcore dance/Trance/House music. Girls, girls and more girls ;) ... In short, everything youg people like, I like :D Oh yeah, and dont't forget politics :)
  • myCENT:48.25

Posted 22 November 2005 - 11:00 AM

Hi

You can do as Inspiron said,make a whole new form,and place controls as you like them.

I was never good in subclassing,but I believe changing button captions can be done using subclassing.I would love to give the example,but as I said,I'm no good with subclassing.As always,I direct people to use the web,Yahoo or Google a bit,and dig out some information that is of interest to you.Because,nothing can stick in peoples minds better,than hard way of finding some info out.Check Planet Source Code (http://www.planet-source-code.com/vb/) for examples on MsgBox usage,maybe there are some of customizing this function.

Cheers

#16 iGuest

    Hail Caesar!

  • Kontributors
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5,876 posts
  • Interests:Trap17 Free Web Hosting, No Ads

Posted 26 November 2007 - 01:11 PM

How do I change the text of a msgbox button, because I'm using them to open to different form. For example.

I'll have the message box sayin "What would to like to do next?"
Then ideally I want two buttons with the text "View Accounts" on one and "Finish" on the other?

#17 iGuest

    Hail Caesar!

  • Kontributors
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5,876 posts
  • Interests:Trap17 Free Web Hosting, No Ads

Posted 04 June 2008 - 07:21 AM

add Show details in message box.
Msgbox

How can I add Show details in Message box. Please anyone help me to do...

-reply by Vijee

#18 iGuest

    Hail Caesar!

  • Kontributors
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5,876 posts
  • Interests:Trap17 Free Web Hosting, No Ads

Posted 27 January 2010 - 12:13 PM

Blinking Text in ExcelMsgbox

Hi.

I need code for blinking text in excel

Please help me for.

Thanks

Hiren

-reply by Hiren Kansara

#19 NNNOOOOOO

    Advanced Member

  • Kontributors
  • PipPipPipPipPipPipPip
  • 146 posts
  • Gender:Male
  • Location:London, KY, USA
  • Interests:Electronics, Vb Scripting (as in type in notepad, save as *.vbs)

Posted 24 July 2010 - 09:04 PM

View Postmarkcqm, on 19 November 2005 - 01:44 PM, said:

Could we change buttom "YES","NO","CANCEL" to other caption?
"ignore, rety, cancel (what happened to "fail"), help.

#20 Papabear

    Newbie [Level 1]

  • Kontributors
  • Pip
  • 10 posts

Posted 28 May 2011 - 08:53 AM

I remember this msgbox, a long ago, not so long, I created a prank program with a form and a one command button in the middle
with the caption "Don't Click Me!", the code is full of msgbox, I think more than a thousand lines? lol
my professor saw it and tried to click it, He was so irritated when he can't finish clicking and clicking
and me? I'm laughing at him of course haha, anyway nice share, for those who don't know msgbox on vb 6




Reply to this topic


This post will need approval from a moderator before this post is shown.

  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users