Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Buttons problem


Reply
 
Thread Tools Display Modes
  #1  
Old 02-13-2004, 07:57 PM
DANY DANY is offline
Centurion
 
Join Date: Jun 2001
Posts: 128
Default Buttons problem


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
Reply With Quote
  #2  
Old 02-13-2004, 08:51 PM
hardrain's Avatar
hardrain hardrain is offline
Junior Contributor
 
Join Date: Dec 2003
Location: Manila, Philippines
Posts: 277
Default

You can use this:

Code:
Select Case Index Case 1 'Then it Case 2 'would be easy Case 3 'to perform operation? End Select
__________________
It's been a while.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Inno and Flash buttons giannicotina Installation / Documentation 5 02-15-2004 09:45 AM
Problem with Toolbars : Unpressing Buttons TSK General 4 11-19-2003 06:37 PM
VBScript Onmouseover, Radio Buttons, displaying an array element problem Bassman Web Programming 0 06-05-2003 03:43 AM
Problem with buttons TheFold Interface and Graphics 4 10-18-2002 08:44 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->