Sunday, 15 March 2015

vb.net - Case Statement not working with String Literals -


Hi all I'm trying to learn VB and I'm having problems with some code I have a specific for production Based on the number my program requires, a check box is checked using case statements, but my code is not working.

  as the object public class frmBTPW Private Sub Form1_Load (, e EventArgs) as handle MyBase.Load End Sub private Sub Button1_Click (object, such as e EventArgs ) handles btncalc.Click dim dblhdr double dim dblfdr double dim dbltdr as double dblhdr = 24 dblfdr = 35 dbltdr = 50 select case "as the Power wash rental" case "half-day rental" chkhd.Checked = truth txtrc.Text = If "poop full day rental" case then "finish" if chkFD.Checked = truth txtrc.Text = dblfdr end if you choose end end Sub possession Function Button1_Click () checkbox as new NotImplementedException Closing Ceremony throw-ended Class  

aid is not outputting anything appreciated.My code text-B ox.

Beyond case statement, respectfully I think that you should read on the difference between a literal value And a convertible "Power Wash Rental" is nothing more than a series of characters, aka AK is a string (similar in this case since the "P" "O" etc.), "a series of rent half day" characters "H" of the following "a" etc.)

"Power wash rental" is a literal string "" half-day rental "and of course they will not match ever

While:.

  string one as a dim = TextBox1.text  

Now, a variable Land. This is the type is a string that contains the series of text (text) text box.


No comments:

Post a Comment