Results 1 to 4 of 4

Thread: Male/Female Name Generator

  1. #1
    New Member
    Join Date
    Jul 12
    Posts
    1

    Male/Female Name Generator

    A Simple Male and Female Name Generator. Needed: 6 Comboboxes, 2 Text Boxes, 4 Buttons, 2 Radial Buttons, and a dialog.
    Screenshots are attached to this post.

    Code Code:
    1. Public Class NameGenerator
    2.  
    3.     Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
    4.         Male1.Visible = True
    5.         Male2.Visible = True
    6.         Male3.Visible = True
    7.         MaleGenerate.Visible = True
    8.         MaleName.Visible = True
    9.     End Sub
    10.  
    11.     Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
    12.         Male1.Visible = False
    13.         Male2.Visible = False
    14.         Male3.Visible = False
    15.         MaleGenerate.Visible = False
    16.         MaleName.Visible = False
    17.         Female1.Visible = True
    18.         Female2.Visible = True
    19.         Female3.Visible = True
    20.         FemaleGenerate.Visible = True
    21.         FemaleName.Visible = True
    22.     End Sub
    23.  
    24.     Private Sub MaleGenerate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles MaleGenerate.Click
    25.         Male1.SelectedItem.GetType()
    26.         MaleName.AppendText(Male1.SelectedItem)
    27.         Male2.SelectedItem.GetType()
    28.         MaleName.AppendText(Male2.SelectedItem)
    29.         Male3.SelectedItem.GetType()
    30.         MaleName.AppendText(Male3.SelectedItem)
    31.     End Sub
    32.  
    33.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    34.         MaleName.Clear()
    35.     End Sub
    36.  
    37.     Private Sub FemaleGenerate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles FemaleGenerate.Click
    38.         Female1.SelectedItem.GetType()
    39.         FemaleName.AppendText(Female1.SelectedItem)
    40.         Female2.SelectedItem.GetType()
    41.         FemaleName.AppendText(Female2.SelectedItem)
    42.         Female3.SelectedItem.GetType()
    43.         FemaleName.AppendText(Female3.SelectedItem)
    44.     End Sub
    45.  
    46.     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    47.         If RadioButton1.Checked = True Then
    48.             My.Computer.FileSystem.WriteAllText("C:\Documents and Settings\All Users\Desktop\MName.txt", MaleName.Text, True)
    49.         ElseIf RadioButton2.Checked = True Then
    50.             My.Computer.FileSystem.WriteAllText("C:\Documents and Settings\All Users\Desktop\FName.txt", FemaleName.Text, True)
    51.         End If
    52.         Dialog2.ShowDialog()
    53.  
    54.     End Sub
    55. End Class
    ComboBoxes:
    Set Names to Male1, Male2, Male3, Female1, Female2, Female3.
    Textboxes:
    Set Names to: MaleName, FemaleName.
    Buttons:
    Set 2 Button Names To: MaleGenerate, FemaleGenerate.
    Set Text to Same 2 Buttons to Generate.
    Set other two button Text to Clear, Save
    Radial Buttons:
    Set Text to Male Names, Female Names.
    Inital Visibilty for all items in the Form must be set at invisble. Male items will become visible when Male Names Radial is checked and vice versa for Female.
    Attached Images Attached Images      

  2. #2
    Fanatic Member BenJones's Avatar
    Join Date
    Mar 10
    Location
    Wales UK
    Posts
    540

    Re: Male/Female Name Generator

    Looks intresting from screen shots.

  3. #3
    Web developer Nightwalker83's Avatar
    Join Date
    Dec 01
    Location
    Adelaide, Australia
    Posts
    9,739

    Re: Male/Female Name Generator

    It doesn't work! I followed your instructions but nothing happens except for the controls being visible when the code is run. Could you please upload the zipped project (minus any exe files). I am interested in how the code is supposed to work.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    Please consider giving me some rep points if I help you a lot.
    DON'T BUMP YOUR POSTS!!! Links to my code examples can now be found on my website: My websites
    Please rate my post if you find it helpful!
    Technology is a dangerous thing in the hands of an idiot! I am that idiot.

  4. #4
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 08
    Location
    Trivandrum, Kerala, India
    Posts
    7,557

    Re: Male/Female Name Generator

    I believe the OP had hardcoded some values in the comboboxes. And that's why the code is not working.

    And to get the path to Desktop or MyDocuments(which is different in XP and Vista/Win7), you could use the My.Computer.FileSystem.SpecialDirectories. For My Documents folder, it would be:
    Code:
    Dim strDocu as String = My.Computer.FileSystem.SpecialDirectories.MyDocuments

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD Athlon X2 5200+, ASUS Motherboard, 2 GB RAM, 400 GB HDD, Nvidia 8600 GT 512MB, 19.5" TFT(Wide), Creative 5.1 Home Theater

    Social Group: VBForums - Developers from India

    Skills: PHP, MySQL, jQuery, VB.Net, VB6, Photoshop...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •