Groups | Blog | Home
all groups > vb.net controls > february 2004 >

vb.net controls : Saving Textbox Value Changes


Al NO[at]SPAM n
2/9/2004 3:33:50 PM
Hi.

I'm a newcomer to the discipline of programming, having done a little with
VBA, and now trying to learn VB.net and create a stand alone application.
I'm hoping that someone can help with the following issue which I'm sure is
quite a basic one for more experienced developers.

I have a panel on which there are several textboxes. These text boxes are
populated and all their contents changed using the click event of a command
button calling the subs below.

Sub Stat1()

txtDisplayTitle.Text = "OPERATOR SETTINGS"

txtData1.Text = "Local Control ON"

txtData2.Text = "E/F ON, SEF ON"

txtData3.Text = "Auto Reclose ON"

txtData5.Text = "Reclose 1"

txtData4.Text = "Cold Load IDLE"

txtData6.Text = "Prot 'A' Active"

End Sub

Sub Stat2()

txtDisplayTitle.Text = "SWITCGEAR STATUS"

txtData1.Text = "Work Tag Off"

txtData2.Text = "SF6Normal 35Pag"

txtData3.Text = "Aux Supply Normal"

txtData4.Text = "Battery Normal"

txtData5.Text = " ACR Connected"

txtData6.Text = "ACR Data Valid"

End Sub

Basically, I need to change the value of txtData1 to different text than
that above, in other routines in the project. My question is how do I get
the change to be reflected and remembered in Sub Stat1() above for retention
throughout the running of the programme. I think it might be something to do
with defining public string variables and arrays however have been unable to
work this one out.

I would be grateful for any assistance.

Thanks

Al@n

hirf-spam-me-here NO[at]SPAM gmx.at
2/9/2004 5:04:00 PM
* "Al@n" <not@thisdomain.co.uk> scripsit:
[quoted text, click to view]

\\\
Public Class TheData
Private Shared m_Data1 As String

Public Shared Property Data1() As String
Get
Return m_Data1
End Get
Set(ByVal Value As String)
m_Data1 = Value
End Set
End Property

.
.
.
End Class
///

Usage:

\\\
TheData.Data1 = "Foo"
Me.TextBox1.Text = TheData.Data1
///

--
Herfried K. Wagner [MVP]
Al NO[at]SPAM n
2/10/2004 5:27:38 PM
Herfried

Thanks for the reply, it helped no end.

Al@n

[quoted text, click to view]

AddThis Social Bookmark Button