Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Disable Dragging Items In A Listview Control. Help, Help, Help


I don't know how to disable dragging items in a listview control. Please help me. thank you very much




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Dragging Listview Items
How to drag Listview Item to another form with the same format of Listview.??? hElp please??

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

Disable Selection Of Certain Listview Items
i want to disable selection of certain listview items

deselcting the item when ItemClick is called is a dirty method and isn't complete because the user can still select the item when they hold the mouse button down to make the 'selection field'

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

Visible Disable The Maximise Button In Control Box Items ???
Okay I want to actually visibly disable the max button in a forms control box. Basically I want the user to be able to minimise but not max the form.

any ideas ??

How To Disable A Row In The Listview Control
how to disable a row in the listview control

Items In Listview Control
The structure of the tables are:

Project Table = ProjectID(PK), ProjectName.
Forms Table = FormID(PK), ProjectID, FormName.

Under one project there can be many number of forms. I am displaying all projects in Listview control. I want that when I click on listview control of that particular project it should show me only those forms whcih are related to that project, but now it is displaying all the forms avilable in forms table.

I am writing this code, whats wrong in the code:


VB Code:
Private Sub ListView1_DblClick()    Dim sql As String    With frmFormList        .SY = ListView1.SelectedItem.ListSubItems(1)        sql = "select * from FORMS where [ProjectID]='" + .SY + "'"        .Show    End With    Unload MeEnd Sub


Even I have tried to give this sql command but same error:


VB Code:
sql = "SELECT FORMS.FormID, FORMS.FormName FROM PROJECTS INNER JOIN FORMS ON PROJECTS.ProjectID = FORMS.ProjectID WHERE (((FORMS.ProjectID)=' " + .SY + "'"


The error is item cannot be found in the collection corresponding to the requested name or ordinal. How can I fix this problem?

Add Items Without Dragging Them In
Hi,

I'm using VB6.0 and I'm trying to find a way to create combo and textboxes without dragging them on to the form from the toolbox.
I want to make a program to print out bills and each time the value in the combo is selected, a new combo should appear without using comboboxx.visible = true.

Thanks

Selecting Sub Items Of A ListView Control
Hi guys, in my listview control i need to be able to select any subitem and be able to double click it to edit the text in it. I have searched everywhere and i have found no answers, does anyone know to to do this?

Editing Items In Listview Control
I am using a listview control to add names of children to a list view control. But l want them in edit mode, as soon as they are added to the listview, so l can change the names of them.

my code so far:

VB Code:
set ObjNewChild = LtvChildren.Listitems.add(, , "New Child", 1)LtvChildren.labelEdit = lvwManual


The default of "New Child" is displayed, but l want to be able to edit the name as soon as the item is added. So "New Child" can be edited to "John Smith"

Many thanks for your help

Adding Items To ListView Control???
Hello!!

I have a ListView control woth 2 columns namely "Code" and "Description " respectively.

How do i add items the ListView Control programatically.

thanx

Multiselected Items In ListView Control
Hi,

Is there any other way of reading the list of multiselected items without having to run through every single item in the list? if you have hundreds of items listed or even thousands, this is very length. Does the listview control not have an internal index / list of selected items? separated list or anything?

please help, v.Urgent for me, i appreciate every one's calls are urgent.

:-)

thanks

Clearing Items In ListView Control.
I'd like to Clear ALL the current items in a ListView Control (excluding the headers).

I'm using




Code:

Private Sub btnReboot_Click()
...
frmMainForm.lvwClientComps.ListItems.Clear
...
End Sub


but whenever I do so- I get prompted with the message:

Run-time Error '91'- Object Variable or With block variable not set

Perhaps I'm doing it the wrong way? Any ideas?

Regards,

Metro Mystery

How To Shift Items In Listview Control
I'm trying to arrange files not ascending or descending order but by user's choice. I added 2 buttons: move up and move down. I tried to reassign the indexes using selected item index and trying to change it, but gives error. What way could this be done?

Disable Icon Dragging
Is there anyway to disable the user from resizing a bitmap in a RichEdit? I've tried EM_SETREADONLY, etc, all the properties and methods I can think of it, but none really work. In stuff like MSN Chat and other stuff, when you select the image it just creates a border around it but you can't drag it or anything.

Is there anyway to disable icon dragging in rich edits?

Disable Item Selection In The Listview Control
Hi Guys and girls. I'm filling a listview control with data which I don't want the user to mess with. So can I disable the item selection.

Dragging Items In A Treeview Between Itself
I've got a tree view control in my application and i need to drag its children nodes between the parent nodes. I.e you can be able to change the parent node just by dragging a node from one parent node to anotehr. Is this possible to be done by native VB, or does it need some API involveD?

I've seen several applications using this functionality. Any idea how i can solve this problem?

Thanks!

Folder Items Listed In A Listview Control
What is the fastest way to display a folder's contents in a listview given the path to that folder?
I want to include icons, file size, type... the works.

I've found some optimizations, but it's not enough:

> subclassing the ListView and using a System ImageList instead of the real ImageList control (I tested this)
> scaning the folder with API not the intrisic VB function Dir or the Scripting FileSystemObject (I tested this)
> using a "virtual" listview that is used only to display the data without storing the data in the listview (not tested yet)



If no one knows better, can anyone at least explain me this sample:

http://www.mvps.org/btmtz/vbexplorer/

mostly the part about using "PIDL"

thanks

ListView Control. STop From Editing Items In Listbox
how can i stop from editing items in a listview control as shown in this picture:


http://www.po2upload.com/uploads/no_change.GIF

Disable Image Dragging In Rich Edit
Does anyone know how to disable image dragging in a Rich Edit Textbox? Say you have a icon in the richedit, how do you make it so people can make the icon bigger or drag it? Locking the box only disables text dragging, not image dragging though.

Any idea's?
Thanks!

Dragging Items In A Treeview In Itself (changing Locations)
I need to perform a drag-drop function on a treeview control in which the user can move items between different nodes of the tree.

I need to implement this functionality via dragand drop, so as to make it easy to interact. Is this possible? Do i need to go into detailed API or wiht native VB it is possible?

Any ideas? Thanks a lot ppl

Complete Text Of List Items In Listview Control Not Showing
I have a list view control inside a frame and as the attached screen shot shows the text of the list box items does not completely show. I can make changes to the list box width property but this doesn't help. Any ideas?

How To Disable Dragging/dropping The Windows Desktop Icons
Hi, friends,

I want to disable dragging/dropping the Windows desktop icons by a program. How can I do that? (eg. If a user drag an icon and drop it elsewhere, give a warn messagebox).

Also, I want to disable the "New" submenu in the pop-up menu after Right-clicking the mouse on the Windows desktop. How can I do
that by a program?

Highly appreciated!

ListView DRAGGING
How can I select multiple items by clicking and then dragging over the amount of records that are there?

thanks...

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

Dragging And Dropping From One Listview To Another
Hi all,

How can I drag and drop multiple items including their subitems from one listview to another. Please help.

Thanks,
Nitesh

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??

Listview Icons And Dragging
Is it possible to have the listview Items containing icons not able to drag? If so how?

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.

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

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.

Disable Combo Box Items
Is it possible to disable individual items in a combo box, if not is it possible to change the forecolor of individual items so as I can disable them through code?
Thanks for any help

Disable Items In List Box?
How to disable few items in list box. I want restrict users to view all items but, certain items to be disabled. Any solution?

Disable Items In ListBox
Hi all,

Is it possible to disable (grey out) items in a Listbox?

I am putting items returned from an XML into a listbox, but items with <productid>0</productid> need to be disabled.

Thanks for your help.

Disable Particular Items In List Box
Hai Friends
I am working with List Box. Is it possible to disable some of the items in the list box?
For example my list box has 5 items , but the user should not select two of those 5 items. They are having rights to select only the first 3 items. How can I achieve this? Urgent pls.

Disable Items In Listbox
How can I enable/disable items within a drop-down list box depending on what has been selected in a second drop-down list box?

Thanks,

How To Disable Certain Items Of Combo Box In Vb?
Sometimes, based on requirements from users, we like to disable certain items of combo box. It seems VB doesn't provide support for such thing directly. How can I do that? Thanks for your inputs.

Disable/Enable Menubar Items
I would like to have certain items from a custom menu disabled/enabled when the active Workbook has a filename in the format '#####$ Overview.xls'

Is there an 'On Open File' or 'On Open Menu' event that I can use for this?

Cheers

Help Me To Disable My Menu Items With Database
This is with regards to user's access..

Im trying to get at least a string from my database and set a conditional statement in vb to disable some menu

For example:

dim rs as new adodb.recordset
dim tmp as string

with rs
tmp=.field!Add
iif tmp = "YES",me.mnuAdd.Enabled="TRUE",me.mnuAdd.Enabled="FALSE"
end with

. But still, i cant find the way to disable menu items..

Please Help me to fix this problem.. Im hoping that this forum will help me.. thanks

Disable Or Remove Datacombo Items
My project has 8 datacombo-boxes which are populated from the same list of data.
Is there a way to temporarily either disable/remove items from the list as they are used in each box - I need to ensure that each box contains a unique value from those available in the list presented.

Enable/Disable Menu Items In VB5?
Hi,

I have an MDI form. When the user logs into my application by typing UID and PWD (which is a small popup form), depending on the access rights to the user I need to disable some menu items of my MDI form .

I have created some menu items on MDI form. How can I disable/enable the menu items. I am able to access the menu items by saying "frmMDI.mnuFile" but there is not disable/enable method .

could someone let me know please.

thank you
nath

Dragging In Tab Control
He,
I need to have the capability to switch between tabs by dragging the tab to the desired location.
I don't have any idea how to do it !
Any idea will be really helpfull
Thanks
Sigal

Disable Menu Items On Form Load
The command buttons are enable and working fine. But Menu items (sub items) are not grayed out. Please suggest.

Thanks


Code:
Private Sub Form_Load()

Dim dbMyDB As Database
Dim rsMyRS As Recordset
Dim sSQL As String

Set dbMyDB = OpenDatabase("k:Plan_ManagerDataBank2k3_4.mdb")
sSQL = "SELECT DISTINCTROW ID, GM, PM, TT, CC FROM tblInstall WHERE ID= '" & Environ("USERNAME") & "';"

Set rsMyRS = dbMyDB.OpenRecordset(sSQL, dbOpenDynaset)

Do While Not rsMyRS.EOF
ListUserID.AddItem rsMyRS(0) & " " & rsMyRS(1) & " " & rsMyRS(2) & " " & rsMyRS(3) & " " & rsMyRS(4)
'rsMyRS.MoveFirst
If rsMyRS(1) = True Then
cmdInstallGM.Enabled = 1
Else
MnuInstallGM.Enabled = 0
End If

If rsMyRS(2) = True Then
cmdInstallPM.Enabled = 1
Else
MnuInstallPM.Enabled = 0
End If

rsMyRS.MoveNext
Loop

End Sub

How To Enable And Disable Menu Items By Code
i need to set some menu items not enabled or visible, i can do it from the menu editor, but how can i do it by code? cause later i have to enable and make it visible again.

JCI

Disable Certian Combobox List Items
Does any one know a way to disable certian items in from a list collection of a combobox.

For example:

if a user chooses a certian item from the first combobox, I would like to disable one or more items from a list collection in combo box two.

Copyright © 2005-08 www.BigResource.com, All rights reserved