Click here to Skip to main content
15,896,528 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Rich Text Box Pin
Fred Andres17-Jan-12 7:35
Fred Andres17-Jan-12 7:35 
GeneralRe: Rich Text Box Pin
Eddy Vluggen17-Jan-12 8:26
professionalEddy Vluggen17-Jan-12 8:26 
AnswerRe: Rich Text Box Pin
Dave Kreskowiak17-Jan-12 2:11
mveDave Kreskowiak17-Jan-12 2:11 
GeneralRe: Rich Text Box Pin
Fred Andres17-Jan-12 7:35
Fred Andres17-Jan-12 7:35 
AnswerRe: Rich Text Box Pin
Shameel19-Jan-12 19:03
professionalShameel19-Jan-12 19:03 
QuestionVB Scripting for OUTLOOK 2003 Pin
Yogesh M kumar14-Jan-12 19:09
Yogesh M kumar14-Jan-12 19:09 
QuestionContains Method returns false if string and parameter are equal? Pin
Dominick Marciano14-Jan-12 16:15
professionalDominick Marciano14-Jan-12 16:15 
AnswerRe: Contains Method returns false if string and parameter are equal? Pin
Dave Kreskowiak15-Jan-12 3:46
mveDave Kreskowiak15-Jan-12 3:46 
It's not the Contains method that has the problem. It's your use of the Select Case/Case statements.

The Select Case statement cannot be used the way you're using it. Select Case <testexpression> must evaluate to a elementary datatype, which gets compared to the values listed in the Case statements.

You're putting the testexpressions in the Case statements, which will not work.

The way you're written your code, none of the Case statements should execute, except whats in the Case Else block.

Nothing about Select Case has changed. It's worked the exact same way since .NET 1.0.

Try it yourself on any version of VB.NET:
Dim source As String = "Something"
Select Case source
    Case source.Contains("Some")
        Console.WriteLine("Some: True")

    Case source.Contains("Something")
            Console.WriteLine("Something: True")
End Select

Select Case source.Contains("Something")
    Case True
        Console.WriteLine("Select 2: Contains 'Something' is True")
    Case Else
        Console.WriteLine("Select 2: Else")
End Select

Console.WriteLine("String 'Something' contains 'Something': " & source.Contains("Something"))


GeneralRe: Contains Method returns false if string and parameter are equal? Pin
Shameel19-Jan-12 19:07
professionalShameel19-Jan-12 19:07 
QuestionDatabound combobox filtering issue Pin
Stefano Leoni13-Jan-12 12:29
Stefano Leoni13-Jan-12 12:29 
AnswerRe: Databound combobox filtering issue Pin
Stefano Leoni17-Jan-12 3:17
Stefano Leoni17-Jan-12 3:17 
Questiondrop down list selected value Pin
Seema Bawa13-Jan-12 11:11
Seema Bawa13-Jan-12 11:11 
QuestionRe: drop down list selected value Pin
Richard MacCutchan13-Jan-12 22:31
mveRichard MacCutchan13-Jan-12 22:31 
AnswerRe: drop down list selected value Pin
sri08018818-Jan-12 23:44
sri08018818-Jan-12 23:44 
QuestionOpinions needed on "shared" keyword Pin
nlarson1112-Jan-12 8:05
nlarson1112-Jan-12 8:05 
AnswerRe: Opinions needed on "shared" keyword Pin
Luc Pattyn12-Jan-12 8:16
sitebuilderLuc Pattyn12-Jan-12 8:16 
GeneralRe: Opinions needed on "shared" keyword Pin
nlarson1112-Jan-12 8:21
nlarson1112-Jan-12 8:21 
GeneralRe: Opinions needed on "shared" keyword Pin
Dave Kreskowiak12-Jan-12 8:32
mveDave Kreskowiak12-Jan-12 8:32 
GeneralRe: Opinions needed on "shared" keyword Pin
nlarson1112-Jan-12 8:38
nlarson1112-Jan-12 8:38 
GeneralRe: Opinions needed on "shared" keyword Pin
Dave Kreskowiak12-Jan-12 9:38
mveDave Kreskowiak12-Jan-12 9:38 
GeneralRe: Opinions needed on "shared" keyword Pin
Luc Pattyn12-Jan-12 8:34
sitebuilderLuc Pattyn12-Jan-12 8:34 
GeneralRe: Opinions needed on "shared" keyword Pin
nlarson1112-Jan-12 8:51
nlarson1112-Jan-12 8:51 
AnswerRe: Opinions needed on "shared" keyword Pin
Eddy Vluggen12-Jan-12 10:40
professionalEddy Vluggen12-Jan-12 10:40 
GeneralRe: Opinions needed on "shared" keyword Pin
nlarson1113-Jan-12 2:44
nlarson1113-Jan-12 2:44 
GeneralRe: Opinions needed on "shared" keyword Pin
Eddy Vluggen13-Jan-12 6:34
professionalEddy Vluggen13-Jan-12 6:34 

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.