Click here to Skip to main content
11,927,711 members (58,244 online)
Rate this:
Please Sign up or sign in to vote.
See more: VB8.0 VB
hi there...

how to set text in textbox automatically?

for example:

if textbox1.text = "shutdown" then
textbox2.text = "ok shutting down"
end if

but even though shutdown is indicated in tectbox1.text, textbox2.text does'nt indicate the phrase "ok shutting down"

here is my code:

Private Sub shutdown()
       If receiveRT.Text = "Shutdown" Or "shutdown" Then
           SendRT.Text = "Shutting Down" 
end if
           If SendRT.Text = "Shutting Down" Then
               With srPort
                   .Write("AT+CMGF=1" & vbCrLf)
                   .Write("AT+CMGS=" & Chr(34) & CNtbox.Text & Chr(34) & vbCrLf)
                   .Write(SendRT.Text & Chr(26))
                   MsgBox("Message sent")
               End With
           End If
       End If
   End Sub
Posted 1-May-13 21:28pm
Edited 1-May-13 22:17pm
hemantrautela 2-May-13 3:44am
& what is the problem..???
as you told "how to set text in textbox automatically?"
you done by --- textbox2.text = "ok shutting down"---

On which event you call shutdown()
Member 10021148 2-May-13 4:10am
sir hematrautela, the problem is SendRT.text does'nt show the word shutting down

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

By setting it!
In your sample, you do not set the text property, you just test it for a specific value:
If receiveRT.Text = "Shutdown" Or "shutdown" Then
    If SendRT.Text = "Shutting Down" Then

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.151126.1 | Last Updated 2 May 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100