how do i make it so...

Discussion in 'Archives' started by damien121, Jul 1, 2007.

how do i make it so...
  1. Unread #1 - Jul 1, 2007 at 4:03 PM
  2. damien121
    Joined:
    May 3, 2007
    Posts:
    489
    Referrals:
    0
    Sythe Gold:
    0

    damien121 Forum Addict

    how do i make it so...

    hello.
    i have this thing on a program i made.
    i have 5 text boxes.
    and a cmd button
    when you click the cmd button in action i made it says invalid username etc.
    how would i make it so that if certainn things are in the boxes it does something else?
    So say if certain things were in the boxes and they clicked the cmd button it would send a different message.
    How? and thanks.
     
  3. Unread #2 - Jul 1, 2007 at 10:55 PM
  4. superman1478
    Joined:
    Jan 21, 2007
    Posts:
    701
    Referrals:
    2
    Sythe Gold:
    0

    superman1478 Apprentice

    how do i make it so...

    Code:
    Private Sub Command1_Click()
    If Text1.Text = "sythe" Then
    MsgBox ("runescape 2 cheating")
    End If
    
    If Text1.Text = "runescape" Then
    MsgBox ("a massive mmrpg")
    End If
    
    If Text1.Text = "cruels" Then
    MsgBox ("www.creuls.net")
    End If
    End Sub
    
     
  5. Unread #3 - Jul 2, 2007 at 3:23 AM
  6. Covey
    Joined:
    Sep 9, 2005
    Posts:
    4,510
    Referrals:
    9
    Sythe Gold:
    9
    Discord Unique ID:
    807246764155338833
    Discord Username:
    Covey#1816

    Covey Creator of EliteSwitch
    Retired Sectional Moderator Visual Basic Programmers

    how do i make it so...

    and to loop through all of them: (assuming they are an array)
    Code:
    dim i as long
    for i = 0 to text1.count
      if instr(1,text1(i),"sythe") then
        msgbox "invalid string"
      end if
    next i
     
  7. Unread #4 - Jul 2, 2007 at 6:22 AM
  8. Jazz00006
    Joined:
    Aug 26, 2005
    Posts:
    807
    Referrals:
    0
    Sythe Gold:
    0

    Jazz00006 Apprentice
    Visual Basic Programmers

    how do i make it so...

    Remake of coveys to work without a control array
    Code:
    dim ctl as control
    [INDENT]for each ctl in me.controls
    [INDENT] if typeof(ctl) is TextBox then
    [INDENT] if instr(1,ctl.text,"Covey lol") then
    [INDENT] msgbox "Invalid string"
    [/INDENT]end if 
    [/INDENT] end if 
    [/INDENT] next ctl
    [/INDENT]
    multiple if statements would be a good place to start, since you look like you are new to coding
     
  9. Unread #5 - Jul 2, 2007 at 12:20 PM
  10. Cruel__Machine
    Referrals:
    100

    Cruel__Machine Guest

    how do i make it so...

    Covey's code would be best if you only wanted to check certain textboxes.
    Or you could set the Tag property of the textbox to something other than 0 and check for that within Jazz's loop.
    But if you wanted to check all textboxes on the form, just use Jazz's.
     
  11. Unread #6 - Jul 2, 2007 at 2:00 PM
  12. damien121
    Joined:
    May 3, 2007
    Posts:
    489
    Referrals:
    0
    Sythe Gold:
    0

    damien121 Forum Addict

    how do i make it so...

    Hmm i must refraise this or something.
    i have 5 textboxes.
    and a commandbox.
    if 1 says hello
    2 says okay
    3 says dooby
    4 says moms
    5 says then
    Then when they click the commandbox it sends a message to say hello, welcome to admin part.
    Please understand as best you can. cos if it dont say them in the boxes i want it to say invalid shit

    Please help you kind ppl :)
    thanks
     
  13. Unread #7 - Jul 2, 2007 at 2:14 PM
  14. superman1478
    Joined:
    Jan 21, 2007
    Posts:
    701
    Referrals:
    2
    Sythe Gold:
    0

    superman1478 Apprentice

    how do i make it so...

    Code:
    Private Sub Command1_Click()
    If Text1.Text = "says hello" Then
    If Text2.Text = "okay" Then
    If Text3.Text = "dooby" Then
    If Text4.Text = "moms" Then
    If Text5.Text = "then" Then
    MsgBox ("welcome to admin part.")
    End If
    End If
    End If
    End If
    End If
    End Sub
    
     
  15. Unread #8 - Jul 2, 2007 at 3:16 PM
  16. damien121
    Joined:
    May 3, 2007
    Posts:
    489
    Referrals:
    0
    Sythe Gold:
    0

    damien121 Forum Addict

    how do i make it so...

    nearly, that helped a bit but, i sorted it.
    thanks guys!!!
     
< Buying good runre pure or pure! | Ranger tank! Very CHEAP!!! >

Users viewing this thread
1 guest


 
 
Adblock breaks this site