473,503 Members | 11,508 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 5263
On Fri, 04 Mar 2005 10:50:04 GMT, "Stephen Saunders"
<kd****@earthlink.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****@earthlink.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****@earthlink.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****@earthlink.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****@earthlink.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?

adTHANKSvance,

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****@earthlink.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?

adTHANKSvance,

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_MouseDown event that looks like this:
Sub CmdNext_MouseDown()
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_MouseDown event that looks like this:
Sub CmdNext_MouseDown()
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**@mailinator.com> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.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

"five of nothing" <50**@mailinator.com> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.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 #11
I tried out the advice given and came up with this as an example:-

Add a timer to your form (say Timer1) add a command button to the form (say
Button1) - Set its Enabled Property to False - Set its Interval Property to
100.

Then:-

Private Sub command1_MouseDown(button As Integer, shift As Integer, x As
Single, y As Single)
timer1_timer
Timer1.Enabled = True
End Sub

Sub timer1_timer()
Print "In"
End Sub

Private Sub command1_Mouseup(button As Integer, shift As Integer, x As
Single, y As Single)
Timer1.Enabled = False
Print "Out"
End Sub

Thanks Group

Martin

"Stephen Saunders" <kd****@earthlink.net> wrote in message
news:w3**************@newsread2.news.atl.earthlink .net...
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 #12
I tried out the advice given and came up with this as an example:-

Add a timer to your form (say Timer1) add a command button to the form (say
Button1) - Set its Enabled Property to False - Set its Interval Property to
100.

Then:-

Private Sub command1_MouseDown(button As Integer, shift As Integer, x As
Single, y As Single)
timer1_timer
Timer1.Enabled = True
End Sub

Sub timer1_timer()
Print "In"
End Sub

Private Sub command1_Mouseup(button As Integer, shift As Integer, x As
Single, y As Single)
Timer1.Enabled = False
Print "Out"
End Sub

Thanks Group

Martin

"Stephen Saunders" <kd****@earthlink.net> wrote in message
news:w3**************@newsread2.news.atl.earthlink .net...
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 #13
So I presume it worked?

Jul 17 '05 #14
So I presume it worked?

Jul 17 '05 #15
Yes, and thanks once again.

Martin

"five of nothing" <50**@mailinator.com> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
So I presume it worked?

Jul 17 '05 #16
Yes, and thanks once again.

Martin

"five of nothing" <50**@mailinator.com> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
So I presume it worked?

Jul 17 '05 #17

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

Similar topics

5
9592
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
6445
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...
4
2292
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...
6
1409
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...
8
1908
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...
1
2003
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...
2
4792
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...
5
2866
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
2896
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...
0
7212
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,...
0
7296
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,...
0
7470
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5604
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,...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4696
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...
0
3174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1524
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 ...
1
751
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.