ListView - Stop Icons Moving
Hi, I'm using a listview control in the Icon mode, to display a control panel for my application. The only problem is that when a user clicks an icon, when you move the mouse it moves the icon as well.
Is there any way to stop the user moving the icon?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
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!
LISTVIEW(stoping Icons From Moving..)
i have been seaching for a way to disable moving of icons in a listview.. and i haven't found anything yet. I see it possible in other programs.. but how is it done??? that i don't know. So i am asking you all if there is a way.. a non API approach would be much better.
Stop Txt Moving
can any1 tell me how u stop txt that is in side a pic box moving ever thing u click in the box
Pic Box, Object To Stop Moving
what im trying to do is make it so that i have one bit picture box and a pong design interface inside it(this is a final assignment im making a variation of pong) anywho what im trying to do(and tryed everything i've thought of) is to get it so that when you drag the padel down it cannot pass the line at the top or the bottom, and both these lines are drawn, not made at runtime. thanks for help
also after you hit the line you cannot go down or up further then the line, and you can continue moving inside the two lines
Trying To Stop A Form Moving
hi, i am making a program that has docking forms onto the main mdi form. I am trying to make it so that the forms can be docked and undocked. I have so far made a timer that keeps a form in its position all the time but when the user tries to drag the form it flashes and such and then returns to the position wheras i don't want it to move at all, is there any way i can subclass it to stop it moving?
How Do I Make A Shape Stop Moving?
I have a shape(Shape1) that you can move with the arrow keys....how do i make the Shape1 cease to move when a certain event happens, even though the arrow keys are still pressed?
thanks for any help!
Stop Maximized Form From Moving
I am using a picturebox as a container to act as a mdiparent because only 1 midparent is allowed when I need 2. When I maximize a "child" form, the title bar is still visible which enable the user to move the max form. I get an error when I set moveable=false during runtime. Is there any way to stop the maxed form from moving? Thanks.
How Do I Stop Flickering In Moving Graphics?
I haven't dealt with graphics in vb before, but I know of a common graphics method to reduce/eliminate flicker in animations called double-buffering.
The flicker is caused from clearing the old frame before drawing the new one. To counter this problem you actually would have 2 picture boxes (or whatever you're using) the first one is the visible one that will display the animation. On the second buffer, you do the calculations for the next frame and place all the objects there, then once the frame is ready for display you change the image on the visible buffer to that of the second buffer.
Since I haven't done this in vb before I'm not to helpful in the code department, but hopefully you'll find this method usefull.
Trying To Stop Moving Past Last Record
I am writing a database with a number of tables with forms atttached to each table. I have placed navigation buttons on each form to move to first, last, next, previous. I have set up the code associated with the buttons as "public sub" so it is available for each form to use.
This was working OK except that when I used the NEXT button at the last record it would open a new blank record & keep opening a new blnak record on each click.
To over overcome this I put in an If statement to check if it had moved to a new record. To do this I used the following:
If Me!NewRecord Then ..... etc
Now I get an error "Invalid use of Me key word" I suspect it is because I am using ME in a public sub
How do I overcome the problem of moving passed the last record and still have the coding available to all forms?
The Code is below.
Thnaks for any help.
Public Sub Next_Record_Click()
On Error GoTo Err_Next_Record_Click
DoCmd.GoToRecord , , acNext
If Me!NewRecord Then
' If new record move back to previous
DoCmd.GoToRecord , , acNext
' Send message
MsgBox "This is the last record", , "No More Records"
End If
Exit_Next_Record_Click:
Exit Sub
Err_Next_Record_Click:
MsgBox Err.Description
Resume Exit_Next_Record_Click
End Sub
Stop User Moving The Chart Around In MsChart
VB6 SP6
I am using MsChart. I need to allow selections but when this is set to True users can click on the chart and move the plot area around the unplotted area.
Anybody know a way to avoid this
Thanks
Stop A Moving Image Drawing Over Other Lines...
I have the following code which moves a little image control across the form, but what happens when it moves across slowly is it sort of half draws over lines that I have on the form....how can i get it so that it doesnt draw over the other lines and leaves them intact....so that it doesnt leave this kind of trail.....
VB Code:
Private Sub Timer1_Timer()If Image2.Left < 9240 Then Image2.Left = Image2.Left + 1'only move the picture one space over if it isnt alreadt at the desired locationEnd IfEnd Sub
How To Stop Cursor Keys Moving Focus ?
I am writing a program where an object can be moved round the screen. I first did this using command buttons and then wanted to add the option of using the keyboard cursor keys.
KeyAscii and/or KeyCode worked for most keys but not the cursor keys which didn't seem to generate any events. I got something working using an API call (GetAsyncKeyState).
The bit which still bugs me is that when the user presses the cursor keys, as well as moving the on-screen object, it also moves focus round the various command buttons.
Can anyone suggest how to stop this happening ?
Moving Desktop Icons
Hello, VBForum community!
I am wondering, how would you go about moving a icon on the desktop in VB?
Thanks for any help!
-Spyrorocks
Making A Label Stop Moving When It Hits A Certain Point[solved]
I have a long Label, it shows text, I want it to scroll slowly, but how do I make it stop at a certain point, If I do
VB Code:
Private Sub tmrAbout2_Timer() DoEvents LblAbout.Top = LblAbout.Top - 10 DoEventsIf LblAbout.Top <= 0 Then tmrAbout2.Enabled = FalseEnd Sub
Then it stops when the top of the label hits the top of the form/frame, I want it to scroll through the top of the frame, Its fine if I dont put an If then but it keeps going forever.
Moving A Listview Item And Its Subitems To A New Listview
Hey Guys,
Having a bit of trouble. I am attemping to move a selected item and its subitems from one listview to another. I have no problem getting the contents of the first column, but I can't seem to get the subitems over.
Example: I have this in the first listview:
Code:
|Item |Quanity|Price |PQ |
Bananas 2 $.50 $1.00
Then when I try to move that whole row to the other listview I can only seem to get this:
Code:
|Item |Quanity|Price |PQ |
Bananas
No subitems . Any links or help would be appreciated.
Regards,
Max_Power
Stop Listview Selection
I am trying to stop the first row in a listview being selected when the form is first loaded.
I have tried using the
Code:
Listview1.SelectedItem = Nothing
in the Form_Activate and this doesn't work.
There is no other control on the form to set the focus to.
Any ideas or workarounds?
Stop Listview Flickering?
Hi folks,
I am having trouble in preventing flickering while adding items to a listview.
Please help!
Stop Drag In Listview
I found this code
Code:
' REQUIRES THE MSGHOOK.DLL LIBRARY
Const WM_NOTIFY = &H4E
Const LVN_FIRST = -100&
Const LVN_BEGINDRAG = (LVN_FIRST - 9)
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (dest As _
Any, source As Any, ByVal bytes As Long)
Private Type NMHDR
hwndFrom As Long
idFrom As Long
code As Long
End Type
Dim WithEvents FormHook As MsgHook
Private Sub Form_Load()
' start subclassing the current form
Set FormHook = New MsgHook
FormHook.StartSubclass Me
' fill the ListView1 control with data
' ... (omitted) ...
End Sub
' this event fires when the form is sent a message
Private Sub FormHook_BeforeMessage(uMsg As Long, wParam As Long, lParam As Long, _
retValue As Long, Cancel As Boolean)
' the ListView might be notifying something to its parent form
If uMsg = WM_NOTIFY Then
' copy the MNHDR structure pointed
' to by lParam to a local UDT
Dim nmh As NMHDR
CopyMemory nmh, ByVal lParam, Len(nmh)
' check whether the notification is from the ListView1 control
' and whether it's the beginning of a drag operation
If nmh.hwndFrom = ListView1.hWnd And nmh.code = LVN_BEGINDRAG Then
' yes, cancel this operation
retValue = 1
Cancel = True
End If
End If
End Sub
but I can't get it to work (I have a lisview on my form).
It craps out at:
Dim WithEvents FormHook As MsgHook
Any ideas?
Stop Listview Loading
Hi everyone!
I'm filling a listview with a lot of data. If the user gets tired, he can press a button "Cancel" which should stop the listview loading.
To do that, in the loading loop I put a flag which is continously read at every cycle, for example:
Code:
While count<MaxCount And GoOn
'fill listview
'...
count +=1
End while
' Routine for cancelling
Private sub OnBtnCancel_click (...)
GoOn=False
end sub
However, while the listview is filling up, I cannot press any button because the UI is freezed. So the Cancel button is unuseful.
Usage of Listview.BeginUpdate and Listview.EndUpdate() is useless.
The only way I found to make this work is to have the listview filled by another thread... but this is of course illegal because one should have the UI thread which created the listview to handle it, and not another thread.
Does someone have an idea?
Thank you
Stop Movement Of Listview Icon
hello friends,
I add items (as Icons) and set the view to Icons. When I select and move
one of the items within the listview control, it appears to drag outside the
boundaries of the listview control and the vscroll and hscroll bars appear.
The problem is I want the items to remain aligned, not randomly spread
around. Also, this is a problem because my list view control is about 2
inches square. Can I keep the icon within the white space of the control
and can I keep everything aligned?
How To Stop The Renew Index's For Listview ?
peace be with you
i make a small project used " listview "
i add a 3 items therefore the index's will be [ 1 - 2 - 3 ]
when i remove the index "2" the index's changes like this [ 1 - 2 ]
and number [2] is the index 3 before the removed
the question is :
how to set the index's not changes ??
thanks
Stop ListView Column Header
Hi Everyone,
I am using an example from VBnet about subclassing and responding to notifications from the ListView Header.
http://vbnet.mvps.org/index.html?cod...ifications.htm
The question I am trying to figure out is this. How can I get a column header to stop resizing once it has gotten to a location to a certain location. For example, stop column 1 from resizing any smaller when pt.X = 20. I would appreciate any help.
Thanks.
Stop ListView Selection When Not Wanted
Wow... that's a tough topic. It's easier to explain than what it means in the subject.
I have a TreeView-ListView interfase. The problem I'm having is when I right-click over the ListView, e.g., show it's corresponding popupmenu, and select an option which would not open any new menu or something. E.g., change some values to variables, or change the apearance of the app. What happens is that the mouse (I don't know how to explain it) "keeps" on selection status, and would select all the items you hover the mouse over after this. Of course, this would end if you click anywhere or sth. But I want to avoid this "autoselection status". Does anybody know how to do it??
Stop And Start A Service From A ListView
Hi
I want to be able to stop and start a service that is selected from a ListView, I've tried searching but cant find anything, does anyone have any ideas?
Thanks
LIVERPOOL FOOTBALL CLUB - 5 times Champions of Europe!! 1977, 1978, 1981, 1984, 2005
FA Cup Winners - 2006
Edited by - johneast on 3/15/2006 6:31:40 AM
Stop Code From Moving On If "IF" Statements False [Solved]
hi, i want to verifi the first two boxes before it moves onto the rest of the code so if any of the first two if statements are false it doesnt move onto the rest of the code, any 1 have any ideas?
thx much appreachiated
Private Sub cmdcal_Click()
If cboCars = "" Then MsgBox "Error Msg Here"
If txtdays = "" Then MsgBox "Error Msg Here"
lbltotal = lblPrice * txtdays
lbldeposit = (lbltotal / 100) * 20
lblPay = lbltotal - lbldeposit
End Sub
Listview - Icons
hello folks,
for my latest project I am working on iw ould like to have a listview (reportstyle) with several items in it. For a more "spreadsheet-like-look" I have the gridlines on.
What I would like to do now is to indicate with an icon what item the user selected. So when the user clicks an item a little arrow-like icon appears before in front of the selected line and the icon disappears on the item that was previously selected.
I was thinking to first remove all the markers and then place a marker on the selected item (this because I don't know a method to check the previously selected Item)
for code I have this:
Code:
Private Sub lsvContracts_Click()
Dim NrOfItems As Integer
'remove marker from previous selected item
NrOfItems = lsvContracts.ListItems.Count
For i = 1 To NrOfItems
lsvContracts.ListItems(i).SmallIcon = 0 'no marker should displayed
Next i
lsvContracts.Refresh
'put marker before selected Item
lsvContracts.SelectedItem.SmallIcon = 2
End Sub
this just doesn't seem to be working, I just don't know what to do next.
Does anybody have an Idea how to solve this!!
Listview Icons
I have icons on a listview but I cant get them to line up beside the listitems :
code:
ListView1.View = lvwReport
ListView1.ColumnHeaders.Add , , "Total Users"
ListView1.ColumnHeaders.Add , , "Members"
For UserLoop = LBound(Usernames) To UBound(Usernames)
Set itmX = ListView1.ListItems.Add(, , Usernames(UserLoop))
ListView1.ListItems.Add , , LivveIcon, , 1
Set itmX = Nothing
Next
Can someone plz help?
Icons In Listview
how can i add an icon in a listview. I've searched the forum already and i have to set the imagelist first in the properties, but they are all empty and i dont know how to add something in it. So can anyone help me with this please, how to put the icons in it, and what to do next from there.
Listview Icons
Hi Everyone,
I have a list view box and I would like to place an Icon on each line.
The list view has subitems so it needs to be viewed in the Report View format.
Any ideas?
BDS
>>> ListView And Icons <<<
Hello, all together!
My problem is that:
When I select an entry with an icon of a ListItem control, the icon is/was selected, too. How can I avoid now, that the icon is selected?
Thanks for Help, Marco.
Listview Icons
i have this code to put as icon in my listview
Code:
ListView1.ListItems.Add() = Text1.Text
ListView1.Icons = ImageList1.ListItems
but it doesn't work.Because is the first time i use this property i don't know nothing so i want help as much as you can
ListView Icons
I'm displaying different types of data in a ListView control. Some data types have icons, some do not. All the data with icons are displayed together and all the data without icons are displayed together after the Listview has been cleared. After displaying data with icons, when data is displayed without icons the text stays shifted to the right as if there was still an icon there. Is there a way to move the text back to the left when no icon is displayed? I've tried setting the view to lvwReport or lvwList and refreshing the ListView control but it hasn't worked. Thanks for the help!
ListView + Icons
Hello, it's me again
I have a ListView control returning a transaction history, with succeeded transactions, transaction warnings and transaction errors. Right now, it's just plain text. I would like to put an icon in front of each line, depending on the type off message (Suc., Warn., Err.). Can I do this in my ListView or would you replace it with a grid ?
Greetz,
Yoda
<font color=green>Do or do not
There is no try</font color=green>
ListView Icons
I've added little up and down arrows to indicate how my listview is sorted. What's bugging me is that I cant figure out how to tell a columnheader object that it is to have no icon: i.e. the listview is sorted by another column. How do I de-select an icon in this instance?
Thanks.
ListView Icons
Hello!
I was wondering if it is possible to add images to a ListView controls without needing an ImageList control.
I am re-writing a program which connects to Amazon and downloads CD/DVD covers. If the user enters an unspecific keyword like "Pink Floyd" for example, a lot of images will be returned in the XML file Amazon provides because there are a lot of CDs and DVDs made by Pink Floyd. Let's say 200 images are available. At the moment, the program operates in the following way:
Connect to Amazon and pass subscription ID, keywords, media type...Fetch the "index" XML file Amazon generated and obtain the total number of pages.Loop though all pages and for each page, loop trough the items and look if an image is available. If an image is available, store the URL in an array.Terminate the connection.If the image URL array is not empty, loop through the array and download all files. After each image was downloaded, load it into the ImageList control.After the ImageList control is full of images, start another loop which adds items to the ListView and connect the ImageList with the ListView so the images appear as thumbnails.As you can see, there are a lot of loops there. While the loops in step 3 cannot be avoided (since I have to loop through all pages and all items of the individual pages), I was wondering if I can somehow avoid the other loops by directly adding an item to the ListView and load an image from the disk (rather than from an ImageList).
Any idea if this is possible?
Regards,
Sebastian
Help - Icons In A Listview
Hey,
I need some help with this. Made a search here in the forum but still can't figure it out.
The Listview View property is Report and I would like to add items to a listview with an icon next to each item. The icon is the same for all items.
The ImageList already holds the Icon. I get error Invalid Key
Code:
.listFiles.ListItems.Add , , FileName, , .ImageList1.ListImages.Item(1)
Thanks
ListView Icons...
How can I get an icon/picture to appear in the listview column header, to the RIGHT of the caption?
At the moment, they are all going to the left, which I don't like...
Listview Icons
I have icons on a listview but I cant get them to line up beside the listitems :
Code:
ListView1.View = lvwReport
ListView1.ColumnHeaders.Add , , "Total Users"
ListView1.ColumnHeaders.Add , , "Members"
For UserLoop = LBound(Usernames) To UBound(Usernames)
Set itmX = ListView1.ListItems.Add(, , Usernames(UserLoop))
ListView1.ListItems.Add , , LivveIcon, , 1
Set itmX = Nothing
Next
Can someone plz help?
Listview Icons...
Yeah so I have a listview. Whenever a certain action is fired I want it to add icons to it right? Well I want it to add and Icon for the ping. When lets say someone joines the channel, it gets their ping.
But whenever it adds it to the listview, it will ALWAYS come out the icon number 21. Also, when I view all of the icons, they sometimes appear all jumbled up and weird looking. Like icons all over the place? Here Is my full code for this action.
VB Code:
Private Sub ee_OnUser(Username As String, Flags As Byte, Message As String, Ping As Integer)main.lchannel.Caption = ""main.lchannel.Caption = main.ee.CurrentChannelDim IconNumber As IntegerDim PingNumber As IntegerDim strRealProduct As StringIf Ping <= 99 ThenPingNumber = 16End IfIf Ping <= 199 ThenPingNumber = 17End IfIf Ping <= 299 ThenPingNumber = 18End IfIf Ping <= 399 ThenPingNumber = 19End IfIf Ping <= 499 ThenPingNumber = 20End IfIf Ping <= 600 ThenPingNumber = 21End IfIf Ping >= 600 ThenPingNumber = 21End If'ignore this stuff it worksIf ReverseString(Left(Message, 4)) = "blaah" ThenIconNumber = 10strRealProduct = "blaah"ElseIf ReverseString(Left(Message, 4)) = "blaah" ThenIconNumber = 7strRealProduct = "blaah"ElseIf ReverseString(Left(Message, 4)) = "blaah" ThenIconNumber = 11strRealProduct = "blaah"ElseIf ReverseString(Left(Message, 4)) = "blaah" ThenIconNumber = 6strRealProduct = "blaah"ElseIf ReverseString(Left(Message, 4)) = "blaah" ThenIconNumber = 14strRealProduct = "blaah"ElseIf ReverseString(Left(Message, 4)) = "blaah" ThenIconNumber = 62strRealProduct = "blaah"ElseIf ReverseString(Left(Message, 4)) = "blaah" ThenIconNumber = 2strRealProduct = "blaah"ElseIconNumber = 64End IfIf Flags = 2 ThenIconNumber = 1End IfIf Flags = 18 ThenIconNumber = 1End IfIf Flags = 16 ThenPingNumber = 22End If'stop ignoringIf main.lchannel.Caption = main.ee.Home Thenmain.lpeople.Caption = main.lvchannel.ListItems.Count + 1AddChat vbCyan, Username, vbRed, " is in " + main.ee.CurrentChannel + " with ", vbCyan, Flags, vbRed, " flags, ", vbCyan, Ping, vbRed, " ping, using, ", vbCyan, strRealProduct, vbRed, "." If IconNumber = 1 Thenmain.lvchannel.ListItems.Add 1, , Username, , IconNumbermain.lvchannel.SelectedItem.ListSubItems.Add , , , PingNumber ElseIf Username = main.ee.Username Thenmain.lvchannel.ForeColor = &H80000004main.lvchannel.ListItems.Add , , Username, , IconNumbermain.lvchannel.SelectedItem.ListSubItems.Add , , , PingNumbermain.lvchannel.ForeColor = &HFFFF& Else With main.lvchannel.ListItems.Add(, , Username, , IconNumber).ListSubItems.Add , , , PingNumberEnd WithEnd IfEnd If End Sub
I know for a fact that my icon code numbers are right in the ImageList. Thanks for your help.
Big Icons In Listview
Hey guys!
I am having a bad time with listview.
I can put data inside of list view without trouble.
I created an imagelist and I put 2 icons inside of it, and I made the listview get both images from imagelist and show beside of the name of each column ( I have 2). The problem are 2:
1- The icons are very very big beside the name of each column
2- Each registry in the list view are receiving an icon too....And I dont want... =-(
Here is my code
VB Code:
Private Sub ConfiguraLv()Set ListView1.ColumnHeaderIcons = ImageList1Set ListView1.Icons = ImageList1Set ListView1.SmallIcons = ImageList1Dim clmx As ColumnHeaderSet clmx = ListView1.ColumnHeaders.Add(, , "column 1", , , 1)Set clmx = ListView1.ColumnHeaders.Add(, , "column 2", , , 2)Dim itmx As ListItemSet itmx = ListView1.ListItems.Add(, , "data1(0)", , 1)itmx.SubItems(1) = "data1(1)"End Sub
Thanks for your time,
Elminster
Icons And Listview
Hi there,
I am able to fill a listview and show an icon on each listitem.
Now I want to show a different icon when the user selects a particular listitem in the listview.
Does anybody know how to do this?
Many thanx!
Listview Icons
I am using a listview for the data i retrieve from my sql server.
When i retrieve the information i want to give every brand there own logo(icon).
So for example: when i retrieve 'NIKE', the listview have to put the nike icon from my imagelist in the listview. But what if i retrieve 2 different brands like 'NIKE' and 'ADIDAS', how can i give them the good icons?
this is my current code:
VB Code:
While Not rs.EOF Set itmX = lv.ListItems.Add(, , "" & rs(0), , 3) itmX.SubItems(1) = "" & rs(1) rs.MoveNextWend
Icons In ListView
Hi
I have a listview with 3 columns in it. column1 holds a name, column2 holds a phone number, column3 holds a subject. I want to put an icon next to the subject in column3. How is this done?
Thanking you in advance
PORRASTAR
Listview Icons
Is it possible to add my own icons in a listview?
Also, can I change a particular row's icon? As in, can I be specific in a listview? Coz i'm afraid that if i change an icon, the whole listview will have that icon.
Also, if so, how do I refer to a specific row? All i know now is referring to a specific column, like '.subitem(1)'.
Anybody can help me out?
Listview Icons
two questions
1. i've created an app that lets a user drag items from a treeview into a listview (style is lvwIcon). however, if the text of the item that's dragged is quite long, then it overlaps other items in the listview. is there anyway to prevent that?
2. this isn't very important, but if the user drags the items in the listview over to the edges of the listview, it starts scrolling. is there any way to prevent that also?
|