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

#1 MarCrush

    Super Member

  • Validating
  • PipPipPipPipPipPipPipPipPip
  • 203 posts
  • Gender:Not Telling

Posted 04 June 2005 - 04:51 AM

**Message Clipped**

Edited by velma, 01 August 2011 - 08:33 AM.


#2 munim

    Newbie [Level 1]

  • Kontributors
  • Pip
  • 15 posts
  • Location:Bangalore

Posted 04 June 2005 - 06:33 AM

hmm.. maybe you could post how to code what happens when each button is pressed (incase there is more than the OK button)..
i don't use too much of VB myself.. C#.net is nice.

#3 Raptrex

    Super Member

  • Kontributors
  • PipPipPipPipPipPipPipPipPip
  • 293 posts

Posted 04 June 2005 - 01:12 PM

doesnt msgbox just pop up with those text?

#4 lava.alt

    Advanced Member

  • Kontributors
  • PipPipPipPipPipPipPip
  • 125 posts

Posted 11 July 2005 - 02:25 AM

MarCrush, on Jun 4 2005, 04:51 AM, said:

Here are lists of MsgBoxes:

Syntax:
MsgBox Prompt, MsgBoxStyle, Title, HelpFile

MsgBox "Uh, text!", , "Uh, Title!"
MsgBox "Uh, text!", vbCritical, "Uh, Title!"
MsgBox "Uh, text!", vbExclamation, "Uh, Title!"
MsgBox "Uh, text!", vbInformation, "Uh, Title!"
MsgBox "Uh, text!", vbOKCancel, "Uh, Title!"
MsgBox "Uh, text!", vbQuestion, "Uh, Title!"
MsgBox "Uh, text!", vbYesNo, "Uh, Title!"
MsgBox "Uh, text!", vbYesNoCancel, "Uh, Title!"
MsgBox "Uh, text!", vbRetryCancel, "Uh, Title!"
MsgBox "Uh, text!", vbOKOnly, "Uh, Title!"
MsgBox "Uh, text!", vbAbortRetryIgnore, "Uh, Title!"
MsgBox "Uh, text!", vbMsgBoxHelpButton, "Uh, Title!", "C:\HelpFile.hlp"

You can also combine them:
MsgBox "Uh, text!", vbExclamation + vbYesNoCancel, "Uh, Title!"

This is great for noobs.

View Post


i think this guy is only tryin yo get some points

#5 TPFWebmaster

    Newbie [Level 1]

  • Kontributors
  • Pip
  • 13 posts

Posted 26 September 2005 - 07:23 AM

munim, on Jun 4 2005, 12:03 PM, said:

hmm.. maybe you could post how to code what happens when each button is pressed (incase there is more than the OK button)..
i don't use too much of VB myself.. C#.net is nice.

View Post


here is the code for a yes/no/cancel msgbox
ync = MsgBox("Click on yes or no or cancel", vbYesNoCancel + vbQuestion, "Title")
If ync = vbYes Then
'code goes here
ElseIf ync = vbNo Then
'code goes here
ElseIf ync = vbCancel Then
'code goes here
End If


#6 sonorama

    Premium Member

  • Kontributors
  • PipPipPipPipPipPipPipPip
  • 197 posts
  • Location:Cuernavaca, Mexico
  • Interests:Music, Literature, Movies, Arts in General, International Cuisine, Wine and Beer

Posted 26 September 2005 - 07:46 AM

lava.alt, on Jul 10 2005, 08:25 PM, said:

i think this guy is only tryin yo get some points

View Post

Lol, I really don't think he's trying only to get credits, but i can't find his post useful anyway... CheerS!! :ph34r:

#7 alicabektas

    Member [Level 3]

  • Kontributors
  • PipPipPipPipPipPip
  • 91 posts
  • Location:Bosnia
  • Interests:to become programer

Posted 26 September 2005 - 08:35 AM

My advice :

using tutorial for VB or Book

and have example

happily :ph34r: :D

#8 dul

    Member [Level 1]

  • Kontributors
  • PipPipPipPip
  • 73 posts

Posted 20 October 2005 - 02:38 AM

Yes. iT IS GOOD. bUT YOU KNOW, IT IS simple version of WinAPI's mESSAGEBoX function. MessageBox has got more possibilities.

#9 NTD2885

    Newbie

  • Kontributors
  • Pip
  • 5 posts
  • Location:Vietnam

Posted 15 November 2005 - 04:55 PM

MarCrush, on Jun 4 2005, 04:51 AM, said:

Here are lists of MsgBoxes:

Syntax:
MsgBox Prompt, MsgBoxStyle, Title, HelpFile

MsgBox "Uh, text!", , "Uh, Title!"
MsgBox "Uh, text!", vbCritical, "Uh, Title!"
MsgBox "Uh, text!", vbExclamation, "Uh, Title!"
MsgBox "Uh, text!", vbInformation, "Uh, Title!"
MsgBox "Uh, text!", vbOKCancel, "Uh, Title!"
MsgBox "Uh, text!", vbQuestion, "Uh, Title!"
MsgBox "Uh, text!", vbYesNo, "Uh, Title!"
MsgBox "Uh, text!", vbYesNoCancel, "Uh, Title!"
MsgBox "Uh, text!", vbRetryCancel, "Uh, Title!"
MsgBox "Uh, text!", vbOKOnly, "Uh, Title!"
MsgBox "Uh, text!", vbAbortRetryIgnore, "Uh, Title!"
MsgBox "Uh, text!", vbMsgBoxHelpButton, "Uh, Title!", "C:\HelpFile.hlp"

You can also combine them:
MsgBox "Uh, text!", vbExclamation + vbYesNoCancel, "Uh, Title!"

This is great for noobs.

Thankx, you can use number , for exam: 16 = vbCritical

#10 sharpz

    Member [Level 1]

  • Kontributors
  • PipPipPipPip
  • 67 posts

Posted 17 November 2005 - 05:46 AM

dul, on Oct 19 2005, 06:38 PM, said:

Yes. iT IS GOOD. bUT YOU KNOW, IT IS simple version of WinAPI's mESSAGEBoX function. MessageBox has got more possibilities.

View Post

the visual basic 6's MsgBox class is a wrapper for the MessageBoxA WinAPI call. I think it fills in something like this:
MsgBox "Some text", "a title" 
and replaces it with:
MessageBox(NULL, "Some text", "a title", NULL);

the msdn documentation for MessageBoxA says:

Quote

int MessageBox(     
    HWND hWnd,
    LPCTSTR lpText,
    LPCTSTR lpCaption,
    UINT uType
);
so, all the MsgBox class does is replace the hWnd (handle) of the window with NULL and if you dont fill in a parameter it will full in NULL while calling the API call.

hope this clears up some questions with the MsgBox class.




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