home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Join TechIMO for Free!
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
Reply Get bargains at  »  Dealighted.com
 
Thread Tools
Currently Active Users: 2752
Discussions: 188,382, Posts: 2,243,482, Members: 232,612
Old December 15th, 2002, 02:46 AM   Digg it!   #1 (permalink)
Member
 
Join Date: Sep 2002
Posts: 364
VB 6, data list and drag and drop

I'm talking about the list controls that have the little blue icons on your tool bar.

Drag and drop works great with a regular list box, but I need the data list so I can drag a description, but actually drop the bound text.

It has a hard time realizing that when I push the mouse down that I'm picking something. Starting the drag kind of hinders it or something. I usually have to drop the item, them click again on the control that I dropped it to to get the right value inside -- otherwise, it shows my previously selected value.

Anyone have any luck with this?

I was gonna try db list control, but it doesn't like to connect to sql server.

Creosote is offline   Reply With Quote
Old December 17th, 2002, 12:52 AM     #2 (permalink)
Ultimate Member
 
Join Date: Oct 2001
Posts: 21,019
Re: VB 6, data list and drag and drop

Quote:
Originally posted by Creosote
I'm talking about the list controls that have the little blue icons on your tool bar.
Ok not sure what you're referring to here...

Are you trying to drag text or whatever onto a button, have it activate that button with the given text?

Not quite sure what you're asking for
Maybe an example or a product that has this kind of functionality?

vass0922 is online now   Reply With Quote
Old December 17th, 2002, 03:21 AM     #3 (permalink)
Member
 
Join Date: Sep 2002
Posts: 364
Can't send an example, cuz I'm at home.

OK, I've got two list boxes. Or it can be one list box and a text box. Regardless, I drag text from the list box to the other control.

Now this works perfect using regular list box controls.

It doesn't work well using db list controls. db list controls are more data aware than list boxes. db list controls allow you to display text, but also have bound text.

So I'm display some text, but actually dragging the bound text over.

Normally, when you mouse down on a list box, it changes to the property to the text that your mouse was over. This works great with list box controls.

I can mouse down, and begin my drag, and place it in another control.

With a db list control, it doesn't work that way. It drags the PREVIOUSLY selected text over.

Its just like dragging a shortcut out to your desktop from windows explorer. Except instead of using explorer as the source, I'm using a list box, and instead of an icon, its text.

Creosote is offline   Reply With Quote
Old December 17th, 2002, 03:37 AM     #4 (permalink)
Ultimate Member
 
Join Date: Oct 2001
Posts: 21,019
ah IC

hmmm
sounds like a crappy control.. I haven't used too many 3rd party controls to tell you if there is a better one on the market, but my guess would be yes...

I'm wondering if there is a way to fool the control.

For instance

Mouse down on dblist control
picks up previously selected item
(while mouse is still down) call mouse up event, then mouse down event again to make the currently selected text the 'previous' text.
Then you should be able to do your drag drop...

Will that work?

Private Sub List1_MouseDown(blahblahblah)
Call List1_MouseUp
Call List1_MouseDown

End Sub

You'll have to do a check, maybe set a global flag to see if your calling the mouse event or if the mouse is calling it to avoid the infinite loop...
vass0922 is online now   Reply With Quote
Old December 18th, 2002, 01:56 AM     #5 (permalink)
Member
 
Join Date: Sep 2002
Posts: 364
I think that would make an infinite loop, unless I used a counter. It might work. I'll give it a try. There are other things about that control that are different, or harder than the regular list box. For example, I haven't figured out how to scroll the list with code. There is no list index property.

I've just checked, out home, the component is called 'Microsoft DataList Controls 6.0 (SP3)'. Hopefully, I'm running a later service pack at home, maybe this one works OK.
Creosote is offline   Reply With Quote
Old December 18th, 2002, 02:55 AM     #6 (permalink)
Ultimate Member
 
Join Date: Oct 2001
Posts: 21,019
ya you'll want to set a flag
Code:
' global variables
Dim g_RecursiveCall as Boolean
Private Sub List1_MouseDown(blahblahblah)
  If Not g_RecursiveCall Then 
    g_RecursiveCall = True
    Call List1_MouseUp
    Call List1_MouseDown
  End If
  g_RecursiveCall = False 
End Sub
vass0922 is online now   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Most Active Discussions
Is It Just Me? (2887)
The United States Debt (20)
Looks like Burris will get his Sena.. (8)
I think I just killed my computer w.. (24)
Upgrading RAM (5)
hp compaq nc6000 problems (138)
Folderchat Weekday thread (439)
Antec 300 bulk purchase? (11)
Help with an Ati Radeon HD 4850 512.. (27)
Recent Discussions
G&Z 10th Anniversary Specia.. (0)
How to increase my ram? (5)
Building a gaming computer advi.. (2)
Help with an Ati Radeon HD 4850.. (27)
CPU wont boot (4)
2nd video card (1)
special characters in quarkxpre.. (3)
Need help removing my front usb.. (2)
Genuine Broadband Connection my.. (14)
BATCH FILE WONT OPEN!!! HELP!!! (3)
Blackberry Storm, Gears of War .. (1)
Core 2 Quad Q9550 system (3)


All times are GMT -4. The time now is 09:23 PM.
TechIMO Copyright 2008 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28