begginer question...msgbox

  • Thread starter Thread starter Emmie
  • Start date Start date
E

Emmie

hi,

i wanted to display the value of my textbox into my
msgbox. does anyone know the correct code for this?

i have tried.....

MessageBox.Show("You are about to insert the
product: "txtProductName.text" at a price
of "txtPrice.text" into the database. Do you wish to
continue?", "My Application(", MessageBoxButtons.YesNo,
MessageBoxIcon.Information)

this is not being accepted.
can anyone help?
 
You need to use the + operator to add strings together:

MessageBox.Show("bla bla" + myTextBox.Text + " bla bla " + someotherString +
" bla .")

-mike
MVP
 
Actually (for clarity), he should use the "&" for string concatenation and +
for mathmatical addition. Yes, the "+" will work, but the "&" is more self
documenting and has become a VB standard over the years.
 
Back
Top