Click here to Skip to main content
11,719,185 members (79,136 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: VB8.0
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 20:28pm
Edited 1-May-13 21:17pm
hemantrautela at 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 at 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
0 Sergey Alexandrovich Kryukov 1,734
1 OriginalGriff 690
2 Maciej Los 569
3 Richard MacCutchan 540
4 F-ES Sitecore 510

Advertise | Privacy | Mobile
Web02 | 2.8.150901.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