Results 1 to 4 of 4

Thread: Male/Female Name Generator

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2012
    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      

Posting Permissions

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



Click Here to Expand Forum to Full Width