Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Toolbar Index?


Reply
 
Thread Tools Display Modes
  #1  
Old 08-15-2003, 05:14 PM
Gerardoj Gerardoj is offline
Centurion
 
Join Date: Jun 2003
Location: Somewhere over the Rainbo
Posts: 174
Default Toolbar Index?


Hi I have a questions I have a toolbar with 14 buttons and I want to do this :

Code:
If Time > #10:30:00 AM# And Time < #4:00:00 PM# Then Toolbar1.Buttons.Remove 4 Toolbar1.Buttons.Remove 6 Toolbar1.Buttons.Remove 7 Toolbar1.Buttons.Remove 8 Toolbar1.Buttons.Remove 9 Toolbar1.Buttons.Remove 10 Toolbar1.Buttons.Remove 11 end if

and appears me the error 35600: "Index out of bounds"

what is the problem?

Thanks
Reply With Quote
  #2  
Old 08-15-2003, 05:16 PM
Thinker Thinker is offline
Iron-Fisted Programmer

Retired Moderator
* Guru *
 
Join Date: Jul 2001
Location: Fayetteville Arkansas USA
Posts: 18,127
Default

What happens if you do it like this?
Code:
If Time > #10:30:00 AM# And Time < #4:00:00 PM# Then Toolbar1.Buttons.Remove 11 Toolbar1.Buttons.Remove 10 Toolbar1.Buttons.Remove 9 Toolbar1.Buttons.Remove 8 Toolbar1.Buttons.Remove 7 Toolbar1.Buttons.Remove 6 Toolbar1.Buttons.Remove 4 End If
__________________
Posting Guidelines
Reply With Quote
  #3  
Old 08-15-2003, 05:23 PM
Gerardoj Gerardoj is offline
Centurion
 
Join Date: Jun 2003
Location: Somewhere over the Rainbo
Posts: 174
Default

Thanks now works.
Reply With Quote
  #4  
Old 08-15-2003, 05:31 PM
Thinker Thinker is offline
Iron-Fisted Programmer

Retired Moderator
* Guru *
 
Join Date: Jul 2001
Location: Fayetteville Arkansas USA
Posts: 18,127
Default

Do you understand why? As you remove the lower numbered ones, the
ones above it were moving down taking their places. Starting with the
higher numbers and working down deletes just the ones you want.
__________________
Posting Guidelines
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
Toolbar index gabcaly Interface and Graphics 2 07-15-2003 03:22 AM
hide/show a form's border in run time with api setwindowlong wolfmanzeev API 4 04-08-2003 04:10 AM
Sort Problem xzer0cool General 10 12-13-2002 04:57 PM
API code problems with Windows 2000 shootsnlad API 2 08-01-2002 05:44 PM
A nicer way to move a borderless form Merrion Code Library 2 07-18-2002 08:40 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
 
 
-->