473,378 Members | 1,512 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Toolbars Help

I was wondering

I have a toolbar on a form with two buttons on the toolbar. And also a
timer control, i was wondering if anyone would know the code to make
the two buttons exchange places every 1 second.

Thanks

Nov 29 '05 #1
1 838
<zo****@yahoo.com> wrote in message news:11**********************@z14g2000cwz.googlegr oups.com...
I was wondering

I have a toolbar on a form with two buttons on the toolbar. And also a
timer control, i was wondering if anyone would know the code to make
the two buttons exchange places every 1 second.


A strange request... what possible use could this have other
than pure novelty?

The solution is reasonably simple. The following example
assumes the first two buttons have the Text properties New
and Open and have the ImageIndex properties 0 and 1,
respectively.

The Toolbar's Click even should simply check the sender's
Text property to determine its current "state". If your buttons
have no Text, use the Tag property instead. However, if they're
swapping around every second, they're probably not the most
useful of controls to have in your interface.

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim pButton As ToolBarButton
For Each pButton In Toolbar1.Buttons
If pButton.Text = "New" Then
pButton.Text = "Open"
pButton.ImageIndex = 0
ElseIf pButton.Text = "Open" Then
pButton.Text = "New"
pButton.ImageIndex = 1
End If
Next
End Sub

Nov 29 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Steve Dorsey | last post by:
Hello I'm creating a web page that contains a flash presentation. I currently have it resizing the user's web page and placing it on the screen using this script: ...
0
by: Logan | last post by:
I have a C# application that I want to enumerate all of current toolbars for an application and i am having trouble writing some of the API calls. I try to get the number of buttons on the current...
4
by: Karl Irvin | last post by:
In a 2000, can you transfer custom menus and toolbars to a new Access database. My mdf file is not compiling and I'm importing all data to a new database but don't see a way to get the...
1
by: Mario Crevits | last post by:
My name is Mario Crevits, I'm from Belgium (Roeselare) and I'm working with Access97 for several years now. We are in an Access97-2000 migration project. I'm writing a wizard for the end-users to...
1
by: MacDermott | last post by:
I have an MDB file which is secured using a custom MDW file. I'd like to have most users see only the shortened menu you see when you set the Startup option "Allow full menus" to False. But...
1
by: Pete | last post by:
Ok I've searched for yet another hour today trying to find a method of programmatically importing toolbars. I understand how to manually import a toolbar from an older database. But since I'm...
1
by: cefrancke | last post by:
I have set the Startup properties to the following... All menus, toolbars, etc are turned off plus these are unchecked Allow Full Menus Allow Built-in Toolbars Allow Default Shortcut Menus...
3
by: cefrancke | last post by:
The only reason I ask is that no one has made this subject clear or given a definitive answer. What I would like to do is, after turning off all the menus/tbars/etc using the startup options. ...
4
by: MLH | last post by:
Is there a simple way to hide built-in toolbars in A97?
15
by: Neil | last post by:
So, I tried to copy a toolbar. I have a custom menu bar for a form. Tried to copy it so that I could modify the copy and use it with another form. With no direct way to copy it, I made a copy of...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.