ListView And Turning Off Dragging
I have Listview with a number of items and I want a user to be able to select an item by clicking on it. Currently, if they click and drag then the icon and text go flying all over the window. How do you keep them from being able to click and drag on the icons messing up the entire list view but still allow them to click and select one? There are a number of related posts but noone seems to have a straightforward answer and this seems easy. Help please!
Thanks.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Listview - Turning Off Dragging
I'm in one of my old apps and noticed that for some reason I used a listview control when a listbox "might" have done the job. My comments aren't as good as they should be (lesson learned). Anyway, since I'm not sure why I used a listview instead of a listbox I'm not willing to replace it. I don't have the time.
So... Is there a property (that I can't find) that turns off dragging of items in the listview control?
Thanks,
Bernie
ListView DRAGGING
How can I select multiple items by clicking and then dragging over the amount of records that are there?
thanks...
Dragging Listview Items
How to drag Listview Item to another form with the same format of Listview.??? hElp please??
Listview Dragging Item
Hello, Jusk asking if there is a possible way to drag item in the listview??
it goes like this:
Listview populate with;
Item 1
Item 2
Item 3
When I drag Item 3 to the position of Item2, it goes like this;
Item 1
Item 3
Item 2
is this possible?? if not?? what should I do??
Create Shortcut By Dragging From Listview
Was wondering if someone could show me an example of creating a windows shortcut by dragging an item out of a listview control and say onto the desktop.
When creating the shortcut I would like to link to a specifix .exe, but use what was dragged out as part of the command line parameters.
Thanks in advance
Listview: Disabling User Dragging
Is there a way to disable the user from dragging items in a listview. My listview.view=lvwIcon and has to stay that way (e.g. I need the nice large icons)
Thanks in advance,
Listview Setting No Column Dragging
Hi all
you know how with the listview columns you can drag them?
howdo i stop this or get it to resize as soon as the user drags it so its kind of asking howto set the drag to be undraggable
Tom
Dragging Multiple Items From A Listview
i have some code to let users drag an item from a listview onto a treeview node, which works fine, but now i want to let them drag multiple items.
the problem is that when then select a bunch of items, then drag them to the treeview, it leaves only the last item they clicked on selected (as if they selected them, then just left-clicked one of them). is there a way to keep them all selected?
also, just out of interest, is there a way to make the drag icon include some text from each selected listview item along with an icon (like when you drag multiple files in windows explorer)?
thanks for any help
Problem With ListView Control And Dragging
I'm trying to drag an item from one ListView control to another but whenever I click on any of the items the first item is selected no matter which I have clicked on. The drag outline does appear over the selected object though. The ListView control is in report view and all the other relevant code is below, can anyone suggest what I've done wrong?
Many thanks
Geoff
Setting up control:
Dim itmX As ListItem
lsvEvents.ListItems.Clear
lsvEvents.ColumnHeaders.Clear
lsvEvents.ColumnHeaders.Add , "Event", "Event", lsvEvents.Width / 2
lsvEvents.ColumnHeaders.Add , "Time", "Time", lsvEvents.Width / 2
lsvEvents.SmallIcons = imlLog
For each record in a recordset:
Set itmX = lsvEvents.ListItems.Add()
itmX.Text = !Name
itmX.Tag = !EventID
itmX.SubItems(1) = !OpenTime
Select Case !EventType
Case Is = "<Project File>"
itmX.SmallIcon = "Project"
Case Is = "<Resource File>"
itmX.SmallIcon = "Resource"
Case Is = "<Issue>"
itmX.SmallIcon = "Issue"
End Select
MouseDown:
Private Sub lstEvents_MouseDown(Button As Integer, Shift As Integer, x As
Single, y As Single)
Dim DY ' Declare variable.
DY = TextHeight("A") ' Get height of one line.
lblDrag.Move lstEvents.Left, lstEvents.Top + y - DY / 2, lstEvents.Width,
DY
lblDrag.Drag ' Drag label outline.
End Sub
Problem With ListView Control And Dragging
I'm trying to drag an item from one ListView control to another but whenever I click on any of the items the first item is selected no matter which I
have clicked on. The drag outline does appear over the selected object though. The ListView control is in report view and all the other relevant code is below, can anyone suggest what I've done wrong?
Many thanks
Geoff
Setting up control:
Dim itmX As ListItem
lsvEvents.ListItems.Clear
lsvEvents.ColumnHeaders.Clear
lsvEvents.ColumnHeaders.Add , "Event", "Event", lsvEvents.Width / 2
lsvEvents.ColumnHeaders.Add , "Time", "Time", lsvEvents.Width / 2
lsvEvents.SmallIcons = imlLog
For each record in a recordset:
Set itmX = lsvEvents.ListItems.Add()
itmX.Text = !Name
itmX.Tag = !EventID
itmX.SubItems(1) = !OpenTime
Select Case !EventType
Case Is = "<Project File>"
itmX.SmallIcon = "Project"
Case Is = "<Resource File>"
itmX.SmallIcon = "Resource"
Case Is = "<Issue>"
itmX.SmallIcon = "Issue"
End Select
MouseDown:
Private Sub lstEvents_MouseDown(Button As Integer, Shift As Integer, x As
Single, y As Single)
Dim DY ' Declare variable.
DY = TextHeight("A") ' Get height of one line.
lblDrag.Move lstEvents.Left, lstEvents.Top + y - DY / 2, lstEvents.Width,
DY
lblDrag.Drag ' Drag label outline.
End Sub
Stop Item Dragging/moving In ListView
Is there any way you can stop the user from moving the item position in a listview?? I need them to stay the same as i added them first by code, with them being fixed for the user and not allowing any movement of item position!
thanks!
Please Double Check This Dragging From ListBox To ListView Code For Me
I want to drag an item from a listbox to a listview so starting with my lisbox code:
Private DragID As Integer
Private blnAmDragging As Boolean
Code:
Private Sub lstUnalloc_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = vbLeftButton Then
DragID = lstUnalloc.ItemData(lstUnalloc.ListIndex)
End If
End Sub
Code:
Private Sub lstUnalloc_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
On Error GoTo errh
If Button = vbLeftButton Then
If lstUnalloc.ListIndex >= 0 Then
blnAmDragging = True
lstUnalloc.Drag vbBeginDrag
End If
End If
Exit Sub
errh:
errmsg "The following Exception occured : " & Err.Description & ", " & Err.Source & "", "Exception occured in frmMain.lstUnalloc_MouseMove ()"
End Sub
and now my listview:
Code:
Private Sub lvwPeople_DragOver(Source As Control, x As Single, y As Single, State As Integer)
On Error GoTo errh
If blnAmDragging = True Then
If State = vbLeave Then
Set lvwPeople.DropHighlight = Nothing
Else
Set lvwPeople.DropHighlight = lvwPeople.HitTest(x, y)
End If
End If
Exit Sub
errh:
errmsg "The following Exception occured : " & Err.Description & ", " & Err.Source & "", "Exception occured in frmMain.lstlist_DragOver()"
End Sub
Code:
Private Sub lvwPeople_DragDrop(Source As Control, x As Single, y As Single)
If Source = "lvwPeople" Then
Exit Sub
End If
Source.Drag vbEndDrag
Set lvwPeople.SelectedItem = lvwPeople.HitTest(x, y)
MsgBox lvwPeople.SelectedItem.Key
MsgBox DragID
End Sub
I just put 2 msgboxes to test. I have to write sql statements to assign the number to a person. I just need someone to check if I am doing the correct stuff for dragging and dropping.
Turning .frm Into .exe
I downloaded a program made in visual basic 6, and my visual basic is 5, so it doesn't work. And I was wondering, is there a way I can turnall the files that were included with the program, into an exe file so I don't have to load it in Visual Basic? If so, can you tell me where I can download a program to do this?
Turning Off
What would be the code to shutdown the computer immediately for a prank program I'm making?
Turning On And Off Mic
How can I turn off a mic or mute a mic from my speakers. And how do I get that audio from the mic to the speakers with out recording it (real-time).
Thanks,
Ben
Turning Cursor Off
I've looked through the whole MSDN for what I would assume to be a simple answer to a simple question, and I can't find it.
How do you turn the cursor (mouse pointer) on and off in DirectX mode?
Thanks,
Baywolfe
Turning Off Antialiasing
I am using DirectDraw from DirectX 7.
I'm working on an RPG and need to be able to resize my sprites larger for when I enter battle mode. However, when I do so (by making the destination RECT larger than the source RECT) DirectDraw antialias's the sprites ruining the pixel effect I want and also making a magenta border around my sprite ( I'm using magenta as my transparent color).
A weird exception to this is when I use BltFx so that I can horizontally mirror my sprites. In this case it resizes the sprite just fine with absolutely no antialiasing whatsover.
Here's my code I'm using for drawing sprites:
Code:
If reverseflag Then '(i.e. facing right)
destRECT.Left = spnox(0, Cell) + HOMEleft - 0.5 * spnw(0, Cell)
destRECT.Right = destRECT.Left + spnw(0, Cell) * CHARfactor
mbltfx.lDDFX = DDBLTFX_MIRRORLEFTRIGHT
DDS_back.BltFx destRECT, Surfaces(0).Surface, srcRECT, DDBLT_KEYSRC Or DDBLT_DDFX, mbltfx
Else '(i.e. facing left)
destRECT.Left = (spnw(0, Cell) - spnw(0, Cell) - spnox(0, Cell)) + HOMEleft - 0.5 * spnw(0, Cell)
destRECT.Right = destRECT.Left + spnw(0, Cell) * CHARfactor
DDS_back.Blt destRECT, Surfaces(0).Surface, srcRECT, DDBLT_KEYSRC
End If
spnox/y = sprite offsets
spnw/h = sprite width/height
CHARfactor = resize factor
Turning With The Mouse
Hi folks,
I'm making a 3d FPS and i came to the part of the input.
The mouse:
If you want to turn around you'll have to use a circle to pinpoint the exact location to where you are looking to. To calculate where that point is you'll have to use radial math i guess.
like:
i had pictures created but i don't know how to put them here
anyway, I have this circle with a radius of 1
the point where you are looking at is in the top of the circle. When i move to the right. i have to calculate where the point youre looking at is.
example:
lookat point is 1 away from where you stand but when you turn it is still 1 away from you but no the same coordinates because you turn
you: z:80 x90 look at: z81 x90
when you turn
you z80 x90 lookat: z? x?
i know the z is smaller then 81 and the x bigger as 90 but how do i calculate this?
i cam this far:
2 PI r = Surrounding of the circle (pardon my english i'm not english)
so
2 PI 1 = 6.28 (out of my head)
that's the whole surrounding
1 cirlce has 5 radians
so
6.28 / 5 = 1 radian
a circle has 360degrees so when i divide it into 40 parts every part is 9 degrees
so i have the length of the radias and the curve of the turn
how can i calculate where i am looking at?
Is this the way to do this or is there a easier way of turning with your mouse ?
I hope someone can fill me in with the easiest way
tnx in advance
Turning Off Autofilter In Vba
Hi all
I have a worksheet that has filters I wish to remove the filter to ensure that when i copy all the data to another sheet using code there are no errors
thanks for your help
Gary
Turning AutoSave Off And On
I would like to know how to toggle AutoSave on and off in my Excel app. I've tried recording & nothing shows up. I assume it is because it is an add-in and not native Excel. I've tried using the Add-ins collection to get to it, but there doesn't seem to be any methods or properties exposed that would allow me to do this.
Thanks.
Nate
Turning One String Into 2?
Say I have a string, "000ThisIsMyAccount AndThisIsMyPassword"
The 000 tells me that it's an account requesting packet, and I know how to remove that part. That leaves me with "ThisIsMyAccount AndThisIsMyPassword""
How can I split that string with 2 words into 2 strings? I need to split it at the space (Or, if that'd be easier, I can make it a comma)
Turning Off USB Ports
I am looking for some code that will allow me to turn on and off a USB port on my computer. (Which I have about 8 of)
Reason being is that when a user is not using the fingerprint scanner I want to turn it off. When the user needs to use it, I would like to turn it back on.
Maybe just put it into sleep mode or something? Like when you use windows XP and go into sleep mode, it turns off the USB drives yet when u wake it up, it comes on and doesn’t say "USB drive detected".
I’m not really picky about that, but if I turn on/off the USB port and the fingerprint scanner is in it, every time it comes on it will pop up that bubble saying that which would not look nice.
Thank you for your time,
David
Turning Off Computer
I am having trouble turning off my computer.
It's a laptop, the power button is stuck. I can't take out the battery because the screw heads are SCREWED. Also, I have a virus, so the start menu is missing.
Is there a code in vb that I can use to turn off my computer????
BEFORE IT BLOWS UP!
My Printer Is Turning Against Me
I have developed an print routine, that will print possibly the most beatifull and exciting invoice in the world.
It works, at work.
I took this home, and it printed strange Cyrrilic characters, or hangs up for good.
I set the printer.font to 'Courier New'
I put this in debug and when I go to immediates and go
? printer.fontcount
usually the machine hangs
when it does not it prints random blobs.
the layout of the 'blobs' bears no relation to the print normally
ok, what do I do next to check this.
Thanks
Simon
Turning Off IMMEDIATE Window
Can anyone tell me what i have to do to stop the IMMEDIATE window showing in the top left corner of the screen everytime i run a project? Its normally switched on with Control+G but i cant stop it coming up everytime i Play my app. thanks for any help
Turning A Var Into A Command
Ok i've got a problem, and i'll try to explain. We know you can go to a function in a different sub by using sub.function
Now my problem is this. In one sub I set a var to some sub.function Then I call a global function in the same way, but it has to return me to another function. After doing that global function to open a file and put all contents in an array, I want to return the Array to a function in a different sub. This is set in the var I just mentioned. (this make any sense ??) So theoretically I would use sub.function (array) and it would work fine. But now the Sub.function part is contained in a var. See my problem ? I can understand if this makes no sense at all...... If needs be I can post my code also
Turning Off Ctrl+Z?
Has anyone got any idea how to turn off the automatic Undo through Ctrl+Z on a RichTextBox control? I want to add a menu item with Ctrl+Z for my own, multiple, undo.
Cheers
Turning Sound On/off
Hi VbCitiziens,
I have a very simple problem: I have a little program that plays shockwave files. Now, I would like to be able to turn on and off sounds (the actual sound from the clip). I see 2 possibilities:
1) Have a way to turn off (or mute) the computer sound from inside VB (thus the Windows' volume) - of course I can't stand there and turn on/off the loudspeaker when needed..!
2) [which I'd like better] Find how to turn on/off the sound in the actual shockwave object (I use the Shockwave Flash component), but unfortunately I can't find any property that would do that.. (this would be great cause at some point I may need to create new audio files to overlay to the clips, in different languages, so this way I could mute the clip and overlay a different wave file)
Anybody has experience with this? (of courseI have no idea how to do either.. )
Thanks!
Cheers
Spank
PS: if this is the wrong forum all apologies, redirect me please I'll post it in whatever is the most appropriate one.
Turning Off Backlight
How would one do an (Fn plus D) key combination in VB. This turns off the screen backlite on a Sony Laptop Confuser.
73 RSH
Turning Off Keybord
I have done a search on the forum without much luck!
This is what i am trying to do!
the program i am writing is to prevent RSI! after a set time i need to disable the mouse and keyboard for a set time, then turn it back on to allow the user to carry on!
If any1 can help, I will glady include you in the credits
cheers
Oh yea, mouse is fine, just need to turn off keyboard
FileListBox Turning Black
i read this in some othe thread
Quote:Originally Posted by FireXtolVB6 uses common controls v5, XP has v6. You have to use InitCommControls API, and create a manifest file, which preloads some assembly to make the application use the newer version.
i had this problem a few weeks ago, where i gave an exe to a friend (i didn't install it on his computer, just gave the exe) who uses Win XP Pro,
where in the program i had a FileListBox that diplayed entirely black on his computer (exept when u clicked on a file u could see the letters of the selected file in white...)
is this due to a different version in common control's or becuz of something else like a different colordepth he's using? Could it also
happen to other control's?
------------------
Anyway God says u better dont use it and replace it with a listbox,
so i guess i don't have to worry
Turning Off AutoUpdate In Excel?
Hello All, finally managed to get back to Visual Basic and away from the other boring duties of my job...anyhow I'm currently working on some script that needs to go through any .xlt file it finds in a folder, open it, scan through, grab some info, and close it. I know how to handle this, but I don't really want the user to have to watch me open and close all these files, plus, I'm sure it takes more time to show the user what I'm doing. A guy here at work said something about turning AutoUpdate off/on, but so far this morning I've not found out how to accomplish this. Any help would be appreciated. Thanks!
Turning Off Form Events
Is there a way to temporarily stop control "_Change" methods from being called or is a global flag the only way to deal with this?
Turning Off Screen Updating In VB6?
i have a couple of forms with a bunch of datagrids, and i'd like to compeltely turn off screen updating while i do calculations on them in order to speed things up.
how do i turn off screen updating?
Turning Warning Messages Off???
I am getting a harmless warning message when I update a column in my datagrid. It simply pops up, the user presses OK and it continues to work.
Is there a way to turn these messages off? I don't want them to show up at all.
I thought there was a way, but I'm having trouble finding it.
Thanks,
Drew
Really Quick.... Turning LONG Into HEX
I want to display a value stored as a long integer as a hex. value.... so
255 would print : 0000ff..... basically I want to convert a LONG colour code into RGB (or BGR as vb uses it) hex value.
Turning A String Into Spaces
Hi,
Is there a better way to turn a variable length string to spaces.
better than...
intLen = len(strText)
for x = 1 to intlen
strtext2 = strtext2 & " "
next x
strtext = strtext2
thanks.
Drawiconex Turning White
when ever a diffrent window goes over the icons on my form they turn white like there not there
is there anything to do to fix that or to tell when the icons are actually visible on the sceen (with the form in focus and when its not)
code im using is
Code:
Dim icon As Long
ico = ExtractAssociatedIcon(App.hInstance, location2, 0)
Picture1(num).Picture = LoadPicture("")
DrawIconEx Picture1(num).hdc, 0, 0, ico, 0, 0, 0, 0, &H1 Or &H2
DestroyIcon ico
Simulate A Fan Blade Turning...how To?
Hello,
I need or would like to have a fan animation in my software, but am concerned about memory usage and how well it would look. Does anyone have ideas or examples on this?
Thanks!
|