indy500fan
asked on
cannot find why string is getting cleared from .text of a textbox
Friends,
I cannot figure out why, but the .text of a textbox is getting cleared.
Here is my code:
Private Sub chkActivateCameraTcpipList ener_Check edChanged( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkActivateCameraTcpipList ener.Check edChanged
Dim FinishLynxCameraIP As String
Dim FinishLynxCameraPort As Integer
Try
MessageBox.Show(txtCamIP.T ext & " " & txtCamPort.Text) '<--- I threw this in to confirm that the .text actually contained a string, and it does, until...
If chkActivateCameraTcpipList ener.Check ed = True Then
FinishLynxCameraIP = txtCamIP.Text '<----At this point .Text = "" and...
FinishLynxCameraPort = CType(txtCamPort.Text, Integer) '<------ .Text = 0
FinishLynxTCPIP.FinishLynx SessionCon nect(Finis hLynxCamer aIP, FinishLynxCameraPort)
Any idea why it would get cleared after the If statement???
Thanks in advance!
Eric
I cannot figure out why, but the .text of a textbox is getting cleared.
Here is my code:
Private Sub chkActivateCameraTcpipList
Dim FinishLynxCameraIP As String
Dim FinishLynxCameraPort As Integer
Try
MessageBox.Show(txtCamIP.T
If chkActivateCameraTcpipList
FinishLynxCameraIP = txtCamIP.Text '<----At this point .Text = "" and...
FinishLynxCameraPort = CType(txtCamPort.Text, Integer) '<------ .Text = 0
FinishLynxTCPIP.FinishLynx
Any idea why it would get cleared after the If statement???
Thanks in advance!
Eric
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
also try using Watch window in the debug mode to monitor the changes in the textbox value
well, ain't this a mystery! Have you stepped through your code and checked the value of txtCamIP.text at the "if" statement and immediately after the "if" statement executes?
ASKER
YZlat,
I tried your suggestion, and it worked. I can't figure out why, but after the Check, the .Text values are cleared.
Thanks!
Eric
I tried your suggestion, and it worked. I can't figure out why, but after the Check, the .Text values are cleared.
Thanks!
Eric