My question is simple yet difficult to find an answer for. I declared a variable which is the sum of two other variables. I simply want to display that result on the screen. I think a msgbox is what I need to use but I'm not sure.
okay, if I wanted to say: "The sum of these numbers is: (total)", how would I go about that?
A-moc
2010-06-05 04:51:32
rockinthesixstring
2010-06-05 04:57:24
A-moc
2010-06-05 05:01:24
belisarius
2010-06-05 05:02:36
Assuming total is an integer or some other numerical type and you're using .NET, you can gain type safety by using Msgbox(total.tostring). If you're using VB6, Str(Total) will give you your type safety.
DaMartyr
2010-06-05 14:32:11
A:
Well are you using a website or winforms?
If you're using a website, just create a label:
<asp:Label ID="lblMessage" runat="server" />
Then in your code behind, just set the message.
Dim Variable as Int
lblMessage.Text = Variable.ToString();
The same can be used above on a WinForm, but in a Winform you can also use:
MessageBox.Show(....);
Jack Marchetti
2010-06-05 04:40:24
fyi.. he didn't state that he's using .NET - thought I do the same thing and default to .NET when I'm answering these things.
rockinthesixstring
2010-06-05 04:59:17