Private Sub Command1_Click()
On Error Goto Worm CommonDialog1.Action = 3 candy = Hex(CommonDialog1.Color) suga = Len(candy) If suga = 5 Then candy = "0" + candy If suga = 4 Then candy = "00" + candy If suga = 3 Then candy = "000" + candy If suga = 2 Then candy = "0000" + candy If suga = 1 Then candy = "00000" + candy txtColor(1).Text = "#" + candy Worm: Exit Sub End Sub '_________________________________________________________ Private Sub cmdColor_Click(Index As Integer) On Error Goto Worm CommonDialog1.Action = 3 candy = Hex(CommonDialog1.Color) suga = Len(candy) If suga = 5 Then candy = "0" + candy If suga = 4 Then candy = "00" + candy If suga = 3 Then candy = "000" + candy If suga = 2 Then candy = "0000" + candy If suga = 1 Then candy = "00000" + candy Text1.Text = "#" + candy txtColor(cmdColor(Index)).Text = CommonDialog1.Color Worm: Exit Sub End Sub '_________________________________________________________ Private Sub TabStrip1_Click() If TabStrip1.SelectedItem.Index = 1 Then Text1.Visible = True Command1.Visible = True Else End If If TabStrip1.SelectedItem.Index = 2 Then txtLocation.Visible = True cmdBrowse.Visible = True Else txtLocation.Visible = False cmdBrowse.Visible = False End If End Sub '_________________________________________________________ 'The following should be put in a module Dim NonVis1 As Control, NonVis2 As Control, Visited As Boolean Function TabStrip(Control1 As Control, Control2 As Control) If Visited = True Then NonVis1.Visible = False NonVis2.Visible = False 'Else 'The first two controls (probably frames) that start as 'visible (on the leftmostTab) 'Set NonVis1 = Form1.Frame1 '<----| 'Set NonVis2 = Form1.Frame2 '<----/ 'Visited = True End If Control1.Visible = True Control2.Visible = True Set NonVis1 = Control1 Set NonVis2 = Control2 Visited = True End Function Inputs:Make sure to change the name of the controls in the Form_Load and the TabStrip1_Click or if you want, for example purposes, create six Frames and one tabstrip. And put the Function In the module and the rest in the form. |