473,545 Members | 2,115 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trouble with Click and DblClick

MFC
Hi

I'm from Denmark so I hope you understand my English. Well, I have a filebox
and when I click on a picture-file, then I have a small picturebox, where I
can preview the file. When I double-click on a file, then should the program
load the file to a editor, but no matter how fast I double-click, then the
filebox assume it's a single click. How can I use the Click and the DblClick
with the filebox control ?? I hope someone is able to help me and thanks
for reading my post.

Oh yes, I use VB 6.0
Sincerely,
Mikael Gitt
# slotgitt #

Jul 21 '05 #1
3 5021

"MFC" <sl******@post. tele.dk> wrote in message
news:42******** *************** @dread16.news.t ele.dk...
Hi

I'm from Denmark so I hope you understand my English. Well, I have a filebox and when I click on a picture-file, then I have a small picturebox, where I can preview the file. When I double-click on a file, then should the program load the file to a editor, but no matter how fast I double-click, then the
filebox assume it's a single click. How can I use the Click and the DblClick with the filebox control ?? I hope someone is able to help me and thanks for reading my post.


Well, the single click will always be executed, which is OK because if the
intent of the user is double click, first it will execute the single click
(which according to you shows a "preview / thumb" image) and then if the
user continues, it will load the file.

Using the example below, you will see that the *FINAL* result is what is
intended.

Private Sub File1_Click()
Label1.Caption = "Single"
End Sub

Private Sub File1_DblClick( )
Label1.Caption = "Double"
End Sub
Jul 21 '05 #2
On Tue, 19 Jul 2005 15:13:12 +0200, "MFC" <sl******@post. tele.dk>
wrote:
Hi

I'm from Denmark so I hope you understand my English. Well, I have a filebox
and when I click on a picture-file, then I have a small picturebox, where I
can preview the file. When I double-click on a file, then should the program
load the file to a editor, but no matter how fast I double-click, then the
filebox assume it's a single click. How can I use the Click and the DblClick
with the filebox control ?? I hope someone is able to help me and thanks
for reading my post.

Oh yes, I use VB 6.0
Greetings. You might wish to do a "work-around." You can assign a
variable that holds the file name for the image that is already
being displayed, and if subsequent Click events match that file
name, call the DblClick event.

Dim DisplayedImageN ame As String

Private Sub File1_Click()
If File1.List(File 1.ListIndex) = DisplayedImageN ame Then
File1_DblClick

DisplayedImageN ame = File1.List(File 1.ListIndex)
Set Picture1.Pictur e = LoadPicture(Dis playedImageName )
End Sub

Private Sub File1_DblClick( )
EditRoutime DisplayedImageN ame
End Sub
Sincerely,
Mikael Gitt
# slotgitt #


Jul 21 '05 #3
On Tue, 19 Jul 2005 15:13:12 +0200, "MFC" <sl******@post. tele.dk>
wrote:
Hi

I'm from Denmark so I hope you understand my English. Well, I have a filebox
and when I click on a picture-file, then I have a small picturebox, where I
can preview the file. When I double-click on a file, then should the program
load the file to a editor, but no matter how fast I double-click, then the
filebox assume it's a single click. How can I use the Click and the DblClick
with the filebox control ?? I hope someone is able to help me and thanks
for reading my post.


You could try doing something like this :-

Private Sub File1_Click()
Timer1.Interval = 500
Timer1.Enabled = True
End Sub

Private Sub File1_DblClick( )
Timer1.Enabled = False
Me.Print "Double"
End Sub

Private Sub Timer1_Timer()
Timer1.Enabled = False
Me.Print "Click"
End Sub

You should really get the system's DoubleClickTime

Private Declare Function GetDoubleClickT ime _
Lib "user32" () As Long

Jul 21 '05 #4

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

Similar topics

2
2506
by: Kim Cunningham | last post by:
I want to be able to dblclick on a combobox and pop up another form. The combobox is in dropdown mode. By default, dbl clicking on the combobox just selects the text. I need to override that. How do I do that? Kim
0
282
by: balg | last post by:
I have an outer control + inner control; I need to capture click + dblclick on outer control; but on click, i focus on the inner control which is directly under the mouse; so dblclick on outer control never fired since it is considered as a click on the innercontrol; how can i achieve this, 1. can i "foresee" that a dblclick is going...
1
1882
by: kgs | last post by:
I have datagrid with in a usercontrol. I have doubleclick event tied to each row to post back with the id of the control. Though i get a postback on double click of the datagrid But double click event handler is not triggered. here is the code snipped for item bound public void OnItemBound(Object Sender, DataGridItemEventArgs e)
5
3045
by: tshad | last post by:
I have been working with setting my drop boxes to allow double clicking to select an item. It worked fine until I made some changes. I then stripped the page down to the bare essentials to find out why it quit working. I found that if I didn't have a linkbutton, it quit working????????? If I changed the linkbutton to a regular button,...
2
1822
by: Eadwine Rose | last post by:
I have this little bitty script on my site that makes a jump to the top of the screen when one double left clicks anywhere in the page. I was wondering if it could be altered so the double left click stays present as it is, and when a key is pressed alongside it, say.. shift, ctrl, alt.. , it will jump to the bottom instead of the top. ...
6
19719
by: Fnord Nase | last post by:
Hi. We're using the dblclick event in some parts of a web app interface, which works okay, but when a user double clicks on a text element, the browser selects some text before executing the event handler. How can I prevent this behaviour? TIA, nase
4
4740
by: Jeff User | last post by:
Hi Using .NET 1.1, C#, web app I (actually our client) would like to be able to double click a selection in a listbox and have it postback to server . There I would want to access the item that was double clicked. Any idea how to go about this? Thanks
3
4360
by: ali3n8 | last post by:
I am using a search form that list records in my database. On the list that shows the records that have been found I have a field called First. When I double click on this field I would like to open that record in the form it was inputed on. I have been partially succesful doing this by using this code: DoCmd.OpenForm "frmcustomerinformation",...
5
13314
matheussousuke
by: matheussousuke | last post by:
Hello, I'm using tiny MCE plugin on my oscommerce and it is inserting my website URL when I use insert image function in the emails. The goal is: Make it send the email with the URL http://mghospedagem.com/images/controlpanel.jpg instead of http://mghospedagem.comhttp://mghospedagem.com/images/controlpanel.jpg As u see, there's the...
0
7468
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...
0
7656
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. ...
0
7757
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5972
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...
0
4945
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...
0
3450
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3443
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1884
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
1
1014
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.