• WSBenoit

    WSBenoit

    @wsbenoit

    Viewing 3 replies - 1 through 3 (of 3 total)
    Author
    Replies
    • in reply to: .Net conversion assesing nulls #1224272

      You have to use “==” to evaluate a value, “=” is to assign a value.

      You can also use .Equals() method which is the better way. Or better yet, if your using a sting and want to check if it’s null or empty use String.IsNullOrEmpty(valueToCheck).

      Hope this helps

      Ben

    • in reply to: CmnDialog #1191715

      Hi,

      I don,t have the examples in VB, but use this in C#

      DirectoryInfo dir = new DirectoryInfo(“C:\”);
      FileInfo[] files = dir.GetFiles(“*.*”,SearchOption.TopDirectoryOnly);
      foreach (FileInfo file in files)
      {

      Console.WriteLine(file.Name);
      }

      Ben

    • in reply to: Simple Code not working? #1190418

      How about referencing your form with oForm instead of TheMainForm

      Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnlogin.Click
      Dim strUsers, strPassword As String
      Dim oForm As TheMainForm
      oForm = New TheMainForm()
      oForm.Show()
      oForm = Nothing

      strUsers = txtUsername.Text
      strPassword = txtPassword.Text
      If strUsers = “Jean Brady” And strPassword = “M1” Then
      oForm .Show()
      Else : oForm .Hide()
      End If
      End Sub

      Hope this helps

      Ben

    Viewing 3 replies - 1 through 3 (of 3 total)