dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: can you pass a string value within msgbox control?

  1. #1
    Join Date
    Dec 2002
    Location
    Birmingham UK
    Posts
    83

    Angry can you pass a string value within msgbox control?

    here is my code :

    Dim name As String
    Dim age As Integer


    name = TextBox1.Text
    age = Val(TextBox2.Text)


    MsgBox("Your name is: " chr(name))

    what i want to acheive in this little test is that i want the msgbox to show up the name within its msgbox control

    i know its easy just forgot all this as 8 years ago i was the top guru in the good old days of vb5 and 6
    Waheed Rafiq

    www.waheedrafiq.com


    MCP x 2 , Network+.CNNA

  2. #2
    Join Date
    Dec 2002
    Location
    Birmingham UK
    Posts
    83

    Re: can you pass a string value within msgbox control?

    I got it working , like i said just need to get into it and stay tune with the real world of vb.net . its kind of fun learning back from basic


    Dim name As String
    Dim MyVar As String
    Dim age As Integer


    name = TextBox1.Text
    age = Val(TextBox2.Text)

    name = MsgBox("Hello your name is:" & name)



    age = MsgBox("Get a life son you are! " & age & " and in need of a good life")
    Waheed Rafiq

    www.waheedrafiq.com


    MCP x 2 , Network+.CNNA

  3. #3
    Join Date
    Jan 2003
    Location
    7,107 Islands
    Posts
    2,487

    Re: can you pass a string value within msgbox control?

    i think the "basic" now is different from the past.. It evolved

    MessageBox.Show(String.Format("Hello your name is : My name is {0}. I am {1} year(s) old.", name, age))
    Busy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)