I am a new user in VBNet. Someboady Please help me to find the solution for the following.
Atpresent I am woking in a electronics based project. I measure the voltage and current measurements in to some string variables. So on each press of a button the values in the variable changes.
I want to display all these measurements (strings) in a single screen. That is I want to use the RealTime Display. There are 100+ values. So If I use 100+ lables in the form, the program becoming slow. So if I want to display 100+ strings, what is the solution. Can I use RichTextBox. If I can Use RichText box, how to program to display 100+ strings from different variables into a single RichTextBox. Thanks


7 Years
Discussion Span
Last Post by sknake
Dim String1 As String = "First String"
Dim String2 As String = "Second String"

' Or assign a value after declaration

String1 = "First String"
String2 = "Second String"

Label1.text = "Both String: " & String1 & String2

Kindly mark thread as solved.

Edited by yorro: n/a

Votes + Comments
That is hardly an answer to his question.

Well, assuming it is:

RNG class for test data:

Public Class RNG
	Public Shared Function GetRandomValues(ByVal arraySize As Integer)
		Dim result As New List(Of Integer)
		Dim i1 As Integer
		For i1 = 0 To arraySize - 1
		Return result.ToArray()
	End Function

	Public Shared Function GetRandomValue(ByVal maxValue As Integer) As Integer
		Dim randomNumber(1) As Byte
		Dim gen As New System.Security.Cryptography.RNGCryptoServiceProvider()
		Dim rand As Integer = Convert.ToInt32(randomNumber(1))
		Return rand Mod maxValue + 1
	End Function
End Class


Imports System.Data

Public Class Form1
	Dim dt As DataTable

	Private Sub RefreshData()
		If Not (dt Is Nothing) Then
			dt = Nothing
		End If
		dt = New DataTable()
		dt.Columns.Add(New DataColumn("Name", GetType(String)))
		dt.Columns.Add(New DataColumn("Value", GetType(Integer)))
		Dim vals() As Integer = RNG.GetRandomValues(100)
		Dim i1 As Integer
		For i1 = 0 To vals.Length - 1
			Dim row As DataRow = dt.NewRow()
			Dim strReadingName As String = "Reading #" + (i1 + 1).ToString()
			row("Name") = strReadingName
			row("Value") = vals(i1)
		DataGridView1.DataSource = dt
	End Sub

	Private Sub ButtonExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonExit.Click
	End Sub

	Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
	End Sub
End Class

I have also attached the project.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.