textboxes (NEWBIE question)
OK, I am an ANSI-C type programmer trying to create a simmple VB.net App. I have several text boxes where the user enters certain numbers. I need to take those entries and produce a result in another text box. To test how to do this, I have a simple equation in code and am trying to place the result in a textbox, with no success. I would appreciate any steering in the right direction.
Richard
Re: Output as Plain Text?
Quote:
Originally posted by richas
OK I have had some sucess with code like:
Fcco.Text = Val(Fosc.Text) * Val(M.Text) * Val(P.Text) * 2
This places the result in the Fcco textbox. Since Fcco IS a textbox, the user could plug values in there which is not what I want since it is only an output. Anyway to have the result show up as plain text?
Richard
In VB6 textboxes were of the variant type. In VB.NET they are solely strings. Therefore
VB Code:
Fcco.Text = Cstr(Val(Fosc.Text) * Val(M.Text) * Val(P.Text) * 2)
There are other ways to convert to strings but that is the easiest.