我想請問一下..
我在做點餐系統,但是我不知道怎麼寫出在一個選項畫面,點選一個鍵後...又跳出另外一個選項畫面...
例如說 我的飲料有分成茶類或是咖啡...(第一面)
怎麼寫出我點選茶類之後 又跳出一個視窗來點選我要紅茶或是綠茶...(第二面)
點選玩要的茶類後,會在第一面的視窗顯示我剛點選的茶類
拜託各位大大囉^^\"
2006-03-18 09:42:00 · 1 個解答 · 發問者 ★★翼 Of Hip-Pop★★ 1 in 電腦與網際網路 ➔ 網際網路 ➔ 其他:網際網路
'做2個表單,利用 Form.Show 1 的方式來開啟另外1個表單,並依所須來設定清單'我是用動態增設元件的方式,你只需開啟1個表單將以下程式直接貼上就可Dim A As ListBox, WithEvents D As CommandButtonPublic C As Integer, F As Form, B As Label, E$Private Sub D_Click()If A = "" Then Exit SubIf Caption = "Form1" Then B = "": C = A.ListIndex: E = A.Text Set F = New Form1 F.Caption = "請選擇種類" F.Show 1Else Form1.B = Form1.E & " : " & A Unload MeEnd IfEnd SubPrivate Sub Form_Activate()On Error Resume NextIf Caption = "Form1" Then Set B = Controls.Add("VB.Label", "B") If Err = 0 Then B.Visible = True: B.Top = A.Height + 60: B.Width = 2600: B.Appearance = 1: B.BorderStyle = 1 A.AddItem "茶類": A.AddItem "咖啡" End IfElse If Form1.C = 0 Then A.AddItem "紅茶": A.AddItem "綠茶" Else A.AddItem "藍山": A.AddItem "卡布其諾" End If Me.Move Form1.Top + 60, Form1.Left + 60End IfA = A.List(0)End SubPrivate Sub Form_Load()Set A = Controls.Add("VB.Listbox", "A")A.Visible = True: A.Width = 2600: A.Height = 2000Set D = Controls.Add("VB.CommandButton", "D")D.Visible = True: D.Caption = "確定": D.Top = 2450End Sub
2006-03-18 20:23:40 · answer #1 · answered by W.J.S. 7 · 0⤊ 0⤋