473,659 Members | 2,683 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Repeat Question

Hello,

I am new to this news group. Please forgive me if this has been asked
before.

In my VB application, I have next and previous command buttons. I would
like to be able to hold the left mouse button down on these buttons and have
the operation repeat. Is this a property?

adTHANKSvance,

Stephen Saunders
Jul 17 '05 #1
16 5278
On Fri, 04 Mar 2005 10:50:04 GMT, "Stephen Saunders"
<kd****@earthli nk.net> wrote:
Hello,

I am new to this news group. Please forgive me if this has been asked
before.

In my VB application, I have next and previous command buttons. I would
like to be able to hold the left mouse button down on these buttons and have
the operation repeat. Is this a property?


A Timer ?
Jul 17 '05 #2
On Fri, 04 Mar 2005 10:50:04 GMT, "Stephen Saunders"
<kd****@earthli nk.net> wrote:
Hello,

I am new to this news group. Please forgive me if this has been asked
before.

In my VB application, I have next and previous command buttons. I would
like to be able to hold the left mouse button down on these buttons and have
the operation repeat. Is this a property?


A Timer ?
Jul 17 '05 #3
On Fri, 04 Mar 2005 10:50:04 GMT, "Stephen Saunders"
<kd****@earthli nk.net> wrote:
Hello,

I am new to this news group. Please forgive me if this has been asked
before.

In my VB application, I have next and previous command buttons. I would
like to be able to hold the left mouse button down on these buttons and have
the operation repeat. Is this a property?


Oops - also you'll need to use the MouseDown and MouseUp events, and
get rid of the Click

I would wrap it in a UserControl (NOT OCXed) and call it something
like a PulseButton
Jul 17 '05 #4
On Fri, 04 Mar 2005 10:50:04 GMT, "Stephen Saunders"
<kd****@earthli nk.net> wrote:
Hello,

I am new to this news group. Please forgive me if this has been asked
before.

In my VB application, I have next and previous command buttons. I would
like to be able to hold the left mouse button down on these buttons and have
the operation repeat. Is this a property?


Oops - also you'll need to use the MouseDown and MouseUp events, and
get rid of the Click

I would wrap it in a UserControl (NOT OCXed) and call it something
like a PulseButton
Jul 17 '05 #5
In responce to the post:
On Fri, 04 Mar 2005 10:50:04 GMT, "Stephen Saunders"
<kd****@earthli nk.net> stated...and I replied:
Hello,

I am new to this news group. Please forgive me if this has been asked
before.

In my VB application, I have next and previous command buttons. I would
like to be able to hold the left mouse button down on these buttons and have
the operation repeat. Is this a property?

adTHANKSvanc e,

Stephen Saunders


You may do better changing the 2 command buttons into a single
horizontal scrollbar control. If you size it down so only the 2 (left
& right) buttons show, it will look like 2 command buttons with left
and right arrows.

Just a thought,
Shell
-
http://drshell.home.mindspring.com/
Into computers since 1972.
WARNING! Information and e-mail addresses contained herein, are for personal use only. By entering this site, you agree that you will use this data only for lawful purposes and that, under no circumstances will you use this data to: allow, enable, or otherwise support the transmission of mass unsolicited, commercial advertising or solicitations via direct mail, electronic mail, or by telephone. Violators will be dealt with accordingly.
-
Jul 17 '05 #6
In responce to the post:
On Fri, 04 Mar 2005 10:50:04 GMT, "Stephen Saunders"
<kd****@earthli nk.net> stated...and I replied:
Hello,

I am new to this news group. Please forgive me if this has been asked
before.

In my VB application, I have next and previous command buttons. I would
like to be able to hold the left mouse button down on these buttons and have
the operation repeat. Is this a property?

adTHANKSvanc e,

Stephen Saunders


You may do better changing the 2 command buttons into a single
horizontal scrollbar control. If you size it down so only the 2 (left
& right) buttons show, it will look like 2 command buttons with left
and right arrows.

Just a thought,
Shell
-
http://drshell.home.mindspring.com/
Into computers since 1972.
WARNING! Information and e-mail addresses contained herein, are for personal use only. By entering this site, you agree that you will use this data only for lawful purposes and that, under no circumstances will you use this data to: allow, enable, or otherwise support the transmission of mass unsolicited, commercial advertising or solicitations via direct mail, electronic mail, or by telephone. Violators will be dealt with accordingly.
-
Jul 17 '05 #7
What J French is saying is to do something like the following:
Add a timer for each button, say TmrNext and TmrPrev. Set their
interval property to the repeat time (how often does it repeat the
click), in milliseconds.
Then, instead of a CmdNext_Click event that looks like this:
Sub CmdNext_Click()
[do stuff]
End Sub

Make a CmdNext_MouseDo wn event that looks like this:
Sub CmdNext_MouseDo wn()
TmrNext_Timer()
TmrNext.Enabled = True
End Sub

And put the [do stuff] in the TmrNext_Timer() event:
Sub TmrNext_Timer()
[do stuff]
End Sub

Finally, add a CmdNext_MouseUp () event to disable the timer:
Sub CmdNext_MouseUp ()
TmrNext.Enabled = False
End Sub

That way, when the user presses the button, it will set off the
MouseDown event. This will first run the TmrNext_Timer() event, which
just does the [do stuff]. Then it will set the timer ticking. Then
every time the timer goes off, it'll do the [do stuff] again. When
they let go of the button, CmdNext_MouseUp (), the timer will be
stopped, so [do stuff] won't happen again.

You would, of course, do the same for CmdPrev. And because all this is
a lot to do twice and would be useful, wrapping it in a UserControl
would be helpful, but not necessary.

The only problem with this plan that I see is that if they clicked and
then dragged off the button to let go (Triggering MouseDown but not
MouseUp), the [do stuff] would keep happening until they clicked the
button again (Triggering MouseDown _and_ MouseUp). But this problem is
easily worked around (click the button again).

Jul 17 '05 #8
What J French is saying is to do something like the following:
Add a timer for each button, say TmrNext and TmrPrev. Set their
interval property to the repeat time (how often does it repeat the
click), in milliseconds.
Then, instead of a CmdNext_Click event that looks like this:
Sub CmdNext_Click()
[do stuff]
End Sub

Make a CmdNext_MouseDo wn event that looks like this:
Sub CmdNext_MouseDo wn()
TmrNext_Timer()
TmrNext.Enabled = True
End Sub

And put the [do stuff] in the TmrNext_Timer() event:
Sub TmrNext_Timer()
[do stuff]
End Sub

Finally, add a CmdNext_MouseUp () event to disable the timer:
Sub CmdNext_MouseUp ()
TmrNext.Enabled = False
End Sub

That way, when the user presses the button, it will set off the
MouseDown event. This will first run the TmrNext_Timer() event, which
just does the [do stuff]. Then it will set the timer ticking. Then
every time the timer goes off, it'll do the [do stuff] again. When
they let go of the button, CmdNext_MouseUp (), the timer will be
stopped, so [do stuff] won't happen again.

You would, of course, do the same for CmdPrev. And because all this is
a lot to do twice and would be useful, wrapping it in a UserControl
would be helpful, but not necessary.

The only problem with this plan that I see is that if they clicked and
then dragged off the button to let go (Triggering MouseDown but not
MouseUp), the [do stuff] would keep happening until they clicked the
button again (Triggering MouseDown _and_ MouseUp). But this problem is
easily worked around (click the button again).

Jul 17 '05 #9

"five of nothing" <50**@mailinato r.com> wrote in message
news:11******** **************@ l41g2000cwc.goo glegroups.com.. .
The only problem with this plan that I see is that if they clicked and
then dragged off the button to let go (Triggering MouseDown but not
MouseUp), the [do stuff] would keep happening until they clicked the
button again (Triggering MouseDown _and_ MouseUp). But this problem is
easily worked around (click the button again).


Actually that is not a problem. Even if they drag away from the command button,
it will still receive the MouseUp event when the user releases the button. The X
and Y values will just be outside the boundaries of the command button.
Jul 17 '05 #10

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

Similar topics

5
9598
by: George C | last post by:
How can I get this to repeat an infinite number of times? Thanks ================= </head> <body onload="starttimer()" onunload="stoptimer()"> <script type="text/javascript">
1
6454
by: Theodore A. Jencks | last post by:
Hi all, I posted a question about a side navigation bar earlier where I was encountering this problem. I thought I'd repost the question in a more general format because I'm not sure people quite understood what I was asking in my last post. Here is what I'd like to do: 1. Have a div tag that's soul purpose is to display a repeating background image in the y-axis. 2. The div tag should also have a fixed width.
4
2298
by: Salvador | last post by:
Hi, Maybe is a simple question but I found difficult to find the answer. Context: I am creating a site where designers ONLY touch the ASPX page and I.S. touch the code behind. Task: I have a simple page that list a number of offers based on info from the
6
1422
by: Simon Gare | last post by:
Hi I have a booking page that the user enters 2 addresses date and time etc what I need is the option for the user to select multiple date entries for the same journey or maybe multiple days ie they want to travel the same journey every Monday or every weekday etc. Thanks in advance Simon Gare
8
1924
by: Csaba Gabor | last post by:
I wrote a .repeat(n) function for strings which seemed to work fine: String.prototype.repeat = function(n) { // repeats the string n times if (n<1) return ""; if (n<2) return this; for (var aStr = ;--n>0;) aStr.push(aStr); return aStr.join(""); }
1
2016
by: nicky77 | last post by:
hi there, i'm pretty inexperienced with CSS, so apologies for the shoddy coding. i'm trying to set a 3 column layout using different background images for each column. however, i have whitespace at the top and sides of the page, which i really want to get rid of. i've used nested divs to create the layout so hopefully i've set these up properly. the other problem i am having is that i want the images to repeat vertically to 100% of the page...
2
4805
XedinUnknown
by: XedinUnknown | last post by:
Hi! I am new to this forum, but not new to web design and programming. Nevertheless, I have never tried to use PNG so extensively in my pages. here's the problem. First, I have found that the PNG backgrounds and images had no transparency and grey around them when viewed in IE6, but I solved this bug using this hack. It works great, but then another problem came up: a background image that had the solution applied to was not repeating...
5
2882
by: win_cpp | last post by:
Hello, I was wondering if there is something equivalent to 'Repeat' pattern in C# where I can say, Repeat(10) myobj.SayHi(); The expansion of this being, for (int i = 0; i < 10; ++i)
4
2910
by: shapper | last post by:
Hello, I am trying to give a background to a Div repeating it on the y direction. Please, notice the alternate of colors: http://www.27lamps.com/Beta/Background/Background.html Does anyone has any idea why is this happening?
0
8427
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8332
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8746
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8525
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7356
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2750
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.