By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,990 Members | 2,279 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,990 IT Pros & Developers. It's quick & easy.

How to simulate a LCD display in VB.NET ?

P: n/a
Hi,

I want to simulate a 20 character x 4 line LCD display in VB.NET (2003).

Previously I tried a text box then a listview and finally a datagrid.
The datagrid I thought would have been the best control to use but I
could not figure out how to write to the cells individually.

The expectation is to be able to write to any cell in the control like
LCD(3,1) = "A"

Any help appreciated

Thanks

Regards

David
Nov 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
David wrote:
Hi,

I want to simulate a 20 character x 4 line LCD display in VB.NET (2003).

Previously I tried a text box then a listview and finally a datagrid.
The datagrid I thought would have been the best control to use but I
could not figure out how to write to the cells individually.

The expectation is to be able to write to any cell in the control like
LCD(3,1) = "A"

Any help appreciated

Thanks

Regards

David


You could use 4 textboxes. You can then use the TextBox.Chars(X) = "A"c.

If you want to handle each cell in a datagrid individually you have to
do it through the datasource. for instance if you use a datatable,
change the cells in the table and the datagrid will change.

Chris
Nov 21 '05 #2

P: n/a
Chris,

Chars does not seem to be a member of textbox. I can only see a chars
member under textbox.text.chars but this is read only.

Can you explain how I write to the character location?

Thanks

Regards

David

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Nov 21 '05 #3

P: n/a
David wrote:
Chris,

Chars does not seem to be a member of textbox. I can only see a chars
member under textbox.text.chars but this is read only.

Can you explain how I write to the character location?

Thanks

Regards

David

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com

Ah, well sorry, I was doing it from memory.

You could use SelectLength/SelectText or do it through substring:

TextBox.SelectionStart = 4
TextBox.SelectionLength = 1
TextBox.SelectionText = "A"c

That would replace the 4th character (maybe the 5th) in the textbox.

Hope that helps.
Chris
Nov 21 '05 #4

P: n/a

"David" <gr****@orbitcoms.com> wrote in message
news:uq*************@TK2MSFTNGP12.phx.gbl...
Chris,

Chars does not seem to be a member of textbox. I can only see a chars
member under textbox.text.chars but this is read only.

Can you explain how I write to the character location?

Thanks

Regards

David

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com


You could also create one textbox with the multiline property set to true,
then access the Lines array (e.g., MyTextBox.Lines(1) would give you the
second line of text). You can then use the various string manipulation
functions to insert and retrieve characters at specific locations within
each line.

The following is from the Visual Studio 2003 MSDN Library:

Public Sub ViewMyTextBoxContents()
Dim counter as Integer
'Create a string array and store the contents of the Lines property.
Dim tempArray() as String
tempArray = textBox1.Lines

'Loop through the array and send the contents of the array to debug
window.
For counter = 0 to tempArray.GetUpperBound(0)
System.Diagnostics.Debug.WriteLine( tempArray(counter) )
Next
End Sub
Dave
Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.