Print a variable to a richtext box

swu

Active member
Joined
Mar 26, 2005
Messages
33
Programming Experience
1-3
I have figured out how to print text to a RichTextBox but can't seem to figure out how to print text and the value of a variable.

Here's a code snipet:

Dim Q As Double

Q = TextBoxQ.Text

Dim Output As New Output()

Output.OutTB.AppendText(ControlChars.NewLine & "Q: " Q)

I get an error when I try to incorporate the value of Q into line of text that will be written to the Rich Text Box OutTB

Thanks in advance,

swu
 

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,524
Location
Lansing, MI; USA
Programming Experience
10+
more importantly Option Strict should be turned on:
VB.NET:
Option Explicit On
Option Strict On

Public Class Form1
  Inherits....yada yada

which means that you would need:
VB.NET:
Dim Q As Double

Q = Convert.ToDouble(TextBoxQ.Text)

Dim Output As New Output()

Output.OutTB.AppendText(ControlChars.NewLine & "Q: " & Q.ToString)
 
Top Bottom