Jump to content


Photo

Message Box In Visual Basic


  • Please log in to reply
3 replies to this topic

#1 Diaz

Diaz

    Young Padawan

  • Members
  • Pip
  • 76 posts

Posted 30 April 2007 - 12:48 PM

Hi There,

My friend asked me today if i knew anything about visual basic..Which i dont :D

Anyway he is trying to make a message box like so..

If countC(0) > (voterscount * 0.5) Then
MsgBox("Absolute Majority to Candidate 1 with", percent1)
Exit Sub
End If

He wants it so a message box says

"Candidate 1 wins with 54% of the votes"

Where of course the 54% is changeable

Does anyone have an idea of how to do this?

Thanks :)

#2 Frozen_W

Frozen_W

    Young Padawan

  • Members
  • Pip
  • 186 posts
  • Gender:Male
  • Location:Belgium, Gistel
  • Interests:Just gimme a PC and i'm happy!<br />Also my friends, some concerts, parties,...<br />After the pc, the usual stuff;)

Posted 30 April 2007 - 01:14 PM

Tell your friend, he should use the notice command,

//make var
var$ = "..."
notice "Absolute..." + var$


#3 Surge

Surge

    Young Padawan

  • Members
  • Pip
  • 11 posts

Posted 30 April 2007 - 03:31 PM

Is your friend doing A-Level computing coursework?

#4 cammarata123

cammarata123

    Young Padawan

  • Members
  • Pip
  • 16 posts

Posted 19 July 2007 - 12:50 AM

msgbox("Candidate 1 wins with " & PercentVar & " of the votes")

this is how you combine parts of a string, use & as 'and'

example

dim MyName as string
MyName = "Nick"

msgbox("Hello " & MyName)

would show

Hello Nick




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users