|
-
Jul 27th, 2012, 01:19 PM
#1
Thread Starter
New Member
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:
Public Class NameGenerator
Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
Male1.Visible = True
Male2.Visible = True
Male3.Visible = True
MaleGenerate.Visible = True
MaleName.Visible = True
End Sub
Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
Male1.Visible = False
Male2.Visible = False
Male3.Visible = False
MaleGenerate.Visible = False
MaleName.Visible = False
Female1.Visible = True
Female2.Visible = True
Female3.Visible = True
FemaleGenerate.Visible = True
FemaleName.Visible = True
End Sub
Private Sub MaleGenerate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles MaleGenerate.Click
Male1.SelectedItem.GetType()
MaleName.AppendText(Male1.SelectedItem)
Male2.SelectedItem.GetType()
MaleName.AppendText(Male2.SelectedItem)
Male3.SelectedItem.GetType()
MaleName.AppendText(Male3.SelectedItem)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MaleName.Clear()
End Sub
Private Sub FemaleGenerate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles FemaleGenerate.Click
Female1.SelectedItem.GetType()
FemaleName.AppendText(Female1.SelectedItem)
Female2.SelectedItem.GetType()
FemaleName.AppendText(Female2.SelectedItem)
Female3.SelectedItem.GetType()
FemaleName.AppendText(Female3.SelectedItem)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If RadioButton1.Checked = True Then
My.Computer.FileSystem.WriteAllText("C:\Documents and Settings\All Users\Desktop\MName.txt", MaleName.Text, True)
ElseIf RadioButton2.Checked = True Then
My.Computer.FileSystem.WriteAllText("C:\Documents and Settings\All Users\Desktop\FName.txt", FemaleName.Text, True)
End If
Dialog2.ShowDialog()
End Sub
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.
-
Jul 29th, 2012, 03:53 AM
#2
Re: Male/Female Name Generator
Looks intresting from screen shots.
-
Jul 29th, 2012, 06:39 AM
#3
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.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Aug 1st, 2012, 10:43 AM
#4
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 FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|