473,671 Members | 2,363 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to simulate a LCD display in VB.NET ?

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
4 5433
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
Chris,

Chars does not seem to be a member of textbox. I can only see a chars
member under textbox.text.ch ars 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
David wrote:
Chris,

Chars does not seem to be a member of textbox. I can only see a chars
member under textbox.text.ch ars 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.Selecti onStart = 4
TextBox.Selecti onLength = 1
TextBox.Selecti onText = "A"c

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

Hope that helps.
Chris
Nov 21 '05 #4

"David" <gr****@orbitco ms.com> wrote in message
news:uq******** *****@TK2MSFTNG P12.phx.gbl...
Chris,

Chars does not seem to be a member of textbox. I can only see a chars
member under textbox.text.ch ars 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 ViewMyTextBoxCo ntents()
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.GetUp perBound(0)
System.Diagnost ics.Debug.Write Line( tempArray(count er) )
Next
End Sub
Dave
Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
11253
by: Christian | last post by:
Hello, As the subject says it, is there a way to simulate a special keypress in JS ? In my case, on loading an HTML page, i'd like to set the cursor at the end of the input text of an <input type=text ...> object. focus() sets the cusor at the beginning Any idea ? Christian.
1
1890
by: charliewest | last post by:
I am trying use server controls or web controls to simulate the following behavior. I've an image wrapped w/in a link to create a rollover effect as if both elements we're one graphic: <a href="javascript:submit();" onMouseOver="MM_swapImage('Image1221','','images/btn_green_on.gif',1)" onMouseOut="MM_swapImgRestore()" id="A1" runat="server"> Next <img src="images/btn_green.gif" alt="Next" name="Image1221" width="16" height="16"...
61
16246
by: /* frank */ | last post by:
I have to do a homework: make a CPU simulator using C language. I have a set of asm instructions so I have to write a program that should: - load .asm file - view .asm file - do a step by step simulation - display registers contents I tried to search con google with no success.
4
5171
by: johnny | last post by:
On a form I would like to simulate a button click when the Enter is pressed. My form is setup and it works if the delegate for the key pressed on the form calls the delegate for the button pressed. But can we simulate a button click instead? This way if later the delegate is changed for the button, we don't forget to do the changes on other events?
1
2210
by: diegocarpintero | last post by:
I am writing a c# class which main purpose is to simulate the dialog with a GUI-application. The idea is that this class can simulate some user actions like mouse clicks on buttons. I have found the following possibilities to simulate it: 1) Use SendInput Function (user32.dll) (unmanaged code) 2) Use System.Windows.Forms.SendKeys (managed code)
4
9829
by: queenma7 | last post by:
Write a program that simulates a soft drink machine. The program should use a structure that stores the following information: Drink name Drink cost Number of drinks in machine The program should create an array of five structures. The elements should be initialized with the following data: Drink Name Cost Number in Machine
1
3040
by: =?Utf-8?B?UmljYXJkbyBRdWludGFuaWxsYQ==?= | last post by:
how to simulate a different time zone? ¿is it possible by code to simulate that i am in a different time zone just for to execute a few lines of code? in my case i am in the time zone "Santiago/Chile" which is GMT-04, but for to execute a few lines of code that demand time zone "GMT 0" i need to change or simulate de time zone "GMT 0" how can i do that?
0
1524
by: nospam | last post by:
Hello, I want to simulate posting to a form method with some data. I don't want to use query strings. I want to 'submit' to a php method with some form fields filled out on the server. So, my web page has 2 forms - one 'runat' server and one HTML form. On a button click in the 'runat' form, I want to POST to the HTML form (which in turn calls my php method).
4
2075
by: c0mm3nt | last post by:
Hi Guys. I'm writing a web crawler (web spider) that crawl all links in a website. My application is a Win32 App, written in C# with .Net framework 3.5. Now I'm using HttpWebRequest an HttpWebResponse to communicate with the web server. I also built my own Http Parser that can parse anything I want. I found all link like "href", "src", "action"... in the parse. But I can not solve one problem: Simulate Client Script in the page (like JS...
0
8471
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8388
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8907
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8817
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8593
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8663
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4396
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2046
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.