Buttons problem

DANY
02-13-2004, 07:57 PM
Hello to all,

Here are my button of arrays

<New Phone > (index =0) <Edit Phone> (index =1) <Cancel> (index =2)

When click <New Phone > (index =0) 'disable

<Edit Phone> (index =1) 'change caption to Save
<Cancel> (index =2) 'enable

when click <Save> (index =1)

<New Phone > (index =0) 'ENABLE
<Save> (index =1) 'change caption to eDIT pHONE
<Cancel> (index =2) 'DISABLE

when click <Edit Phone> (index =1)

<Edit Phone> (index =1) 'change caption to Save
<Cancel> (index =2)
<New Phone > (index =0) 'disable

when click <Cancel> (index =2)
<Cancel> (index =2) 'disable
<Save> (index =1) 'change caption to eDIT pHONE
<New Phone > (index =0) 'enable


my code does not work properly

If Index = 1 Then 'when edit is clicked
If cmdPhone(1).Caption = "Cancel" Then
cmdPhone(1).Caption = "Edit Phone"
cmdPhone(0).Enabled = True
cmdPhone(2).Enabled = False
Else
cmdPhone(Index).Caption = "Cancel"
cmdPhone(2).Enabled = True 'Enable Save buttons caption
cmdPhone(2).Caption = "Save" 'change save buttons caption
cmdPhone(0).Enabled = False 'disable new new phone button
End If
ElseIf Index = 0 Then 'when new phone clicked
cmdPhone(1).Caption = "Cancel" 'change edit buttons caption
cmdPhone(2).Enabled = True
cmdPhone(2).Caption = "Save" 'change Edit Phone buttons caption
cmdPhone(0).Enabled = False 'Disable the New Phone button

ElseIf Index = 1 Then 'if Save clicked
cmdPhone(1).Caption = "Edit Phone"
cmdPhone(0).Enabled = True
cmdPhone(2).Caption = "Cancel"
cmdPhone(2).Enabled = False

End If

thanks

hardrain
02-13-2004, 08:51 PM
You can use this:


Select Case Index
Case 1
'Then it
Case 2
'would be easy
Case 3
'to perform operation?
End Select

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum