BrianPeek.com

A Compendium of Random Uselessness
in Search

Text LCD

Last post Sun, Feb 11 2007 1:24 AM by Brian Peek. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • Sun, Feb 11 2007 12:15 AM

    • rbxslvr
    • Top 25 Contributor
    • Joined on Wed, Jan 10 2007
    • Posts 4

    Text LCD

    I need some help.  I bought a Phidgets Text LCD, and I don't know how to display text using Visual Basic.  I can do it fine with C#, but I am accustomed to Visual Basic.  I am preforming the same setup steps in VB as I am in C#, but in the different syntex.  I get "Object reference not set to an instance of an object."  or NullRefrence error.

    Public Class Form1

        Dim lcd As Phidgets.TextLCD

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
            lcd.open()
            lcd.rows(0).DisplayString = textbox1.text
            lcd.rows(1).DisplayString = textbox2.text
    End Sub


    I think it has something to do with me not declaring a "new" something or other, but I don't know where or what I need to declare.  I'm going to play around with it more, but I figured I'd ask here, because you seem to know what you're talking about when it comes to phidgets.

    Thanks for your time!~!
  • Sun, Feb 11 2007 1:24 AM In reply to

    Re: Text LCD

    You're assumption is correct.  You'll either need to declare your member variable as:

    Dim lcd As New Phidgets.TextLCD()

    Or, create a new instance of the TextLCD class somewhere else in your program, like the form constructor or something as follows:

    lcd = new Phidgets.TextLCD()

Page 1 of 1 (2 items)
Copyright (C) 2008 Brian Peek
Powered by Community Server (Commercial Edition), by Telligent Systems