Click here to Skip to main content
16,008,490 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionhow to get value of one textbox from one form to another in VB.NET? Pin
drmzunlimited13-Oct-02 19:28
drmzunlimited13-Oct-02 19:28 
AnswerRe: how to get value of one textbox from one form to another in VB.NET? Pin
Nick Parker14-Oct-02 1:52
protectorNick Parker14-Oct-02 1:52 
GeneralCollections Pin
mikasa11-Oct-02 6:40
mikasa11-Oct-02 6:40 
GeneralRe: Collections Pin
Nick Parker11-Oct-02 8:11
protectorNick Parker11-Oct-02 8:11 
GeneralASCII Printable Characters Only Pin
Like2Byte10-Oct-02 5:10
Like2Byte10-Oct-02 5:10 
GeneralRe: ASCII Printable Characters Only Pin
Daniel Turini10-Oct-02 5:13
Daniel Turini10-Oct-02 5:13 
GeneralRe: ASCII Printable Characters Only Pin
Like2Byte10-Oct-02 5:45
Like2Byte10-Oct-02 5:45 
GeneralRe: ASCII Printable Characters Only Pin
Richard Deeming11-Oct-02 0:45
mveRichard Deeming11-Oct-02 0:45 
If you're using VB.NET, you can use the IndexOfAny method of the String:
C#:
string s1 = "HELP ME, PLEASE!";
string s2 = " SXPT";
int i = s1.IndexOfAny(s2.ToCharArray());
if (i == -1)
    Console.WriteLine("Characters not found!");
else
    Console.WriteLine("Characters found at position {0}", i);
 
 
VB.NET:
Dim s1 As String = "HELP ME, PLEASE!"
Dim s2 As String = " SXPT"
Dim i As Integer = s1.IndexOfAny(s2.ToCharArray())
If i = -1 Then
    Console.WriteLine("Characters not found!")
Else
    Console.WriteLine("Characters found at position {0}", i)
End If

In VB6, you would have to fake it:
Dim s1 As String : s1 = "HELP ME, PLEASE!"
Dim s2 As String : s2 = " SXPT"
Dim i As Integer
Dim index As Integer
Dim found As Boolean : found = False
 
For i = 1 To Len(s2)
    index = InStr(1, s1, Mid(s2, i, 1)
    If index > 0 Then 
        found = True
        Exit For
    End If
Next
 
If Not found Then
    Debug.Print "Characters not found!"
Else
    Debug.Print "Characters found at position " & index
End If

GeneralCopying controls Pin
Chris Hooper10-Oct-02 3:40
Chris Hooper10-Oct-02 3:40 
GeneralRe: Copying controls Pin
Daniel Turini10-Oct-02 3:58
Daniel Turini10-Oct-02 3:58 
GeneralRe: Copying controls Pin
Chris Hooper10-Oct-02 5:32
Chris Hooper10-Oct-02 5:32 
GeneralRe: Copying controls Pin
Anonymous10-Oct-02 5:38
Anonymous10-Oct-02 5:38 
GeneralMicrosoft Access and VB .Net Pin
Zulfikar Ali9-Oct-02 13:43
Zulfikar Ali9-Oct-02 13:43 
GeneralRe: Microsoft Access and VB .Net Pin
Vipul Bhatt13-Oct-02 19:47
Vipul Bhatt13-Oct-02 19:47 
GeneralRe: Microsoft Access and VB .Net Pin
Zulfikar Ali14-Oct-02 4:18
Zulfikar Ali14-Oct-02 4:18 
GeneralComment tool for VB .Net Pin
JS9-Oct-02 11:32
JS9-Oct-02 11:32 
GeneralRe: Comment tool for VB .Net Pin
Ben Ansell23-Oct-02 21:49
Ben Ansell23-Oct-02 21:49 
GeneralChanging Textbox Background color upon gaining focus Pin
Like2Byte9-Oct-02 10:08
Like2Byte9-Oct-02 10:08 
GeneralRe: Changing Textbox Background color upon gaining focus Pin
Like2Byte9-Oct-02 10:20
Like2Byte9-Oct-02 10:20 
GeneralRe: Changing Textbox Background color upon gaining focus Pin
Daniel Turini9-Oct-02 10:19
Daniel Turini9-Oct-02 10:19 
GeneralLink Error 8577 Pin
Alan Chambers9-Oct-02 9:07
Alan Chambers9-Oct-02 9:07 
Generalcopying and pasting controls and the associated code Pin
Chris Hooper9-Oct-02 5:38
Chris Hooper9-Oct-02 5:38 
GeneralPrint .doc file! Pin
Zulfikar Ali8-Oct-02 10:57
Zulfikar Ali8-Oct-02 10:57 
GeneralRe: Print .doc file! Pin
Zulfikar Ali18-Oct-02 11:49
Zulfikar Ali18-Oct-02 11:49 
General****Visual Basic Programmers Wanted for Game Company**** Pin
GameDesigner7-Oct-02 21:12
GameDesigner7-Oct-02 21:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.