|
-
Jan 5th, 2008, 02:30 AM
#1
Thread Starter
New Member
newbie in vb6 hir... help plz
here's the problem statement:
"You write down people’s birthday on various scraps of paper, on various notepads, and in your pocket calendar. The pieces of paper eventually tend to get lost or misplaced and you do not always carry your pocket calendar, which has incomplete data. Because of this, you miss everyone’s birthdays and have decided to organize the better by building a Visual Basic application. The new application will permit you to view people’s names, birth dates and birth signs by dropping down a list. You further determine that the application should have the capability of adding new data to the existing list. "
i've been able to do almost evrything. the only problem is i don't know how to save the new data in my combobox. meaning, (assuming their are 3 default options in my combobox) and i added a new data to the list then i close the form and re-execute the form, the list should contain 4 datas.
how can i do that? here's my code:
Code:
Dim num As Integer
Private Sub cmdadd_Click()
Combo1.Visible = False
Lblname.Visible = False
lblbday.Visible = False
lblbsign.Visible = False
lblnum.Visible = False
Frame1.Visible = False
Frame2.Visible = False
Frame3.Visible = False
Frame4.Visible = False
cmdadd.Visible = False
cmdadd2.Visible = True
Text1.Visible = True
Text2.Visible = True
Text3.Visible = True
Text4.Visible = True
Label1.Visible = True
Label2.Visible = True
Label3.Visible = True
Label4.Visible = True
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
End Sub
Private Sub cmdadd2_Click()
If Text1.Text <> "" Then Combo1.AddItem Text1.Text
If Text2.Text <> "" Then Combo2.AddItem Text2.Text
If Text2.Text <> "" Then Combo3.AddItem Text3.Text
If Text2.Text <> "" Then Combo4.AddItem Text4.Text
Combo1.Visible = True
Lblname.Visible = True
lblbday.Visible = True
lblbsign.Visible = True
lblnum.Visible = True
Frame1.Visible = True
Frame2.Visible = True
Frame3.Visible = True
Frame4.Visible = True
cmdadd.Visible = True
cmdadd2.Visible = False
Text1.Visible = False
Text2.Visible = False
Text3.Visible = False
Text4.Visible = False
Label1.Visible = False
Label2.Visible = False
Label3.Visible = False
Label4.Visible = False
End Sub
Private Sub Combo1_Click()
num = Combo1.ListIndex
Combo2.ListIndex = num
Combo3.ListIndex = num
Combo4.ListIndex = num
Lblname.Caption = Combo1.Text
lblnum.Caption = Combo2.Text
lblbday.Caption = Combo3.Text
lblbsign.Caption = Combo4.Text
End Sub
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
|