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?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Stop Image Movement
hi all..
i have a question.. how i want to stop the image at certain place?? i've wrote the code..
Private Sub Timer1_Timer()
Image1.Move Image1.Left - 10
End Sub
Stop Choppy Scroll Bar Movement
I have a form with a frame, a scrollbar, and arrays of other controls that are added dynamically(the check boxes, labels, and command buttons).
I cannot figure out how to make the controls scroll gracefully. Here is the code that scrolls the controls....
Code:
Dim i As Integer
For i = 0 To chkRemove.Count - 1
chkRemove(i).Top = VScroll1.Value - chkRemove(i).Top - 48
lblDate(i).Top = VScroll1.Value - lblDate(i).Top - 48
lblOrderNumber(i).Top = VScroll1.Value - lblOrderNumber(i).Top - 48
lblDescription(i).Top = VScroll1.Value - lblDescription(i).Top - 48
lblAmount(i).Top = VScroll1.Value - lblAmount(i).Top - 48
cmdOrderDetail(i).Top = VScroll1.Value - cmdOrderDetail(i).Top - 48
Next i
any help would be GREATLY Appreciated.
ListView Sliders Movement
I am editing a ListView by overlaying a textbox. How can I get the new position to re-locate my textbox when the ListView horizontal slider is used.
I have achieved this by using a textbox array (a textbox for each column) but that brings other problems.
I am a beginner at VB coding. So I'll be lost if your answer is too complex.
Thanx
The early bird may get the worm, but the second mouse gets the cheese.
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
Coordinating A Controls Movement With The Mouse Movement
Hai!
i want to move the small rectangle within the big rectangle
left to right when the mouse move left and right on the screen.
assume screen with is 1024 pixels.
so when the mouse pointer is at the left edge of the screen the small rect should be in the
left edge of the big rect. like if the mouse pointer is at 1024th pixtel the small rect should be also
at the right edge of the big rect.
so how to coordinte the small rect movement with the mouse movement for any screen resolution changes.
Please execute my project. so you will undestand what i requir.
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??
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?
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 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 Icon
How would I make a ListView display an icon at the left then show text right next to that?
Set Listview Icon
My Listview is associated with an imagelist that has 2 icons. I want to set either one based on the value of a boolean variable. I've tried this but doesn't work:
Code:
If MyFlagThen
Set ListView1.MouseIcon = ImageList1.ListImages(0).Picture
Else
Set ListView1.MouseIcon = ImageList1.ListImages(1).Picture
End If
I'm afraid I'm at a loss.
Listview Icon
Hi,
In Listview i want add corresponding file icons.....how can i add this.....any body know abt plz tell me......
Thankyou....
Regards,
Kavi_k
Icon In Listview
How can i add icon in a listview.
I load my listview with shortcut(*.lnk,*.pif)and i want their icon in the listview.
Keep Icon Viewable In ListView ?
(VB6)
I'm using a ListView, and everything seems ok, except when I use icons in the list.
Then, when you select an item (or row), the text gets reversed, but the icon get obscured.
See a picture of the problem here:
snap.gif
Is there a way to keep the icon from 'reversing' or whatever is happening to it when a ListView row is selected?
ListView SubItem Icon
On the ListView, I am trying to get the icon number for the SubItem icon. I have two icon colums on my ListView. One is a SmallIcon, the other is a SubItem icon.
This is the code to add a SubItem icon:
Code:
.ListItems(Index).ListSubItems.Add , , , ICON, TOOLTIP
I would like to know how to find out what the ICON variable is and also the TOOLTIP.
Any ideas?
Sorting A Listview By Icon
I have a listview in report view with 3 columns - 1. Icon, 2. Date, 3. Details.
I can sort the date and details columns with no problems when the column header is clicked.
However, I'd like to group the icons together when column 1 header is clicked.
Each listitem has one of 4 different icons.
How do I do this?
Thanks in advance.
Listview Icon Or Picture
I'm currently trying to make a listview during runtime that adds in values, etc. I want the first item to be an icon or picture based on what it is and I can't seem to find a way to get a column to have an icon at all. I've tried just about everything I can think of. Can someone help me out?
One of my failed attempts to give you a better idea of what I mean.
Code:
Set itmListItem = ListView1.ListItems.Add(, , "")
itmListItem.SubItems(1) = ""
itmListItem.SubItems(2) = strFrom
itmListItem.SubItems(3) = strSubject
itmListItem.SubItems(4) = strTime
ListView1.ListItems.Item(lngIndex).key = strFilePointer
ListView1.ListItems.Item(1).Icon = imgList.ListImages(3).Picture
What i'm trying to do is something like Outlook does when you have an unread mail it shows the little envelope and after you read it it goes away. Thanks in advance.
Print Icon In Listview
Hello,
I like to print the informations in a listview.
No problems so far as long as I have to print out text only.
The problem occurs when I try to print the first item which contains a smalicon. I like to print this icon as a graphic.
How can I do this?
Thanks for help
ListView Displays Icon
Dear Users,
I got ListView and ImageList, but then i'd tried to display the Icon. But it seems to be not working..
I really out of ideas.
Hopefully someone can give me some solution...
Thanks & Regards,
KahFui
Listview Icon In Report
Im using the listview control in report view and am trying to add an icon into one of my columns. Is it possible to do this or is it going to take some tweaking? (Im using Common Controls 5.0 so it is compatable with an XP style manifest file.)
Code:
Dim lvwItem As New ListItem
Set lvwItem = lvwInfo.ListItems.Add
lvwItem.Text = "" 'need an icon here
lvwItem.SubItems(1) = "Column 2"
lvwItem.SubItems(2) = "Column 3"
Icon In Listview Report
Hi!
I got a listview with 2 columns, Icon and Text and its displayed as Report...
How do I list an item with an icon in the first column?
Tnx!!
Keep Icon Viewable In ListView ?
(VB6)
I'm using a ListView, and everything seems ok, except when I use icons in the list.
Then, when you select an item (or row), the text gets reversed, but the icon get obscured.
Is there a way to keep the icon from 'reversing' or whatever is happening to it when a ListView row is selected?
Toolbar/listview 5.0 Icon
i have a problem in using 5.0, i add image or icons. when i run the program, the image works well.. when i close the vb6 and run the program, the image/icons looks old?
what image and icons are compatible with comctl32.ocx? help me pls?
Listview Icon Problem
I'm using a listview to display the results a a quiz that's given to the user.
I want each line to display one of three icons:
"right", "wrong", or "incomplete"
I've added an imagelist with 3 icons that are keyed to match.
I set the imagelist for both the Normal and Small icons properties of the listview.
But when I run the code I always get the 1st icon.
It doesn't matter if I call the icon by key or index.
Any help?
VB Code:
With lsvResults .ListItems.Clear For lQ = 0 To UBound(g_lSelectedQs) If g_tQuestions(lQ).Answered Then If g_tQuestions(lQ).Correct Then sKey = "right" lIndex = 1 Else sKey = "wrong" lIndex = 2 End If Else sKey = "incomplete" lIndex = 3 End If .ListItems.Add(, , CStr(lQ + 1), sKey, 1).ListSubItems.Add , "|", g_tQuiz.Qs(g_lSelectedQs(lQ)).Question' .ListItems.Add(, , CStr(lQ + 1), lIndex, 1).ListSubItems.Add , "|", g_tQuiz.Qs(g_lSelectedQs(lQ)).Question Next End With
Listview Report Icon
Hi guys, how can i center-align a ReportIcon of a listsubitem on a listview control?
ListView Header Icon
I am having slight difficults with my ListView.
The headers of a listview would be like this when they are loaded:
Code:
|Header1 |Header2 |Header3 |
Then I assign an icon to one of them:
Code:
|Header1 |[ICON]Header2 |Header3 |
Then when I remove the icon, it looks like this:
Code:
|Header1 | Header2 |Header3 |
That is ugly. How can I get the text to go back in the initial position ?
ListView Toggle Icon
Hi all,
I am using a listview control in report view.
I have 2 icons in an image list bound to the listview.
Depending on a certain criteria, a listview item will be assigined a small icon index of 1 or 2 (where 1 = on an 2 = off). I also have full row select set to true.
Now, what I want to happen is this:
When a user clicks an item, the smallicon will change or toggle.
I am using the following code:
Code:
Private Sub lvwMain_ItemClick(ByVal Item As MSComctlLib.ListItem)
With Item
If .SmallIcon = 1 Then
.SmallIcon = 2
Else
.SmallIcon = 1
End If
End With
End Sub
Here is the problem:
If I click on the small icon, the toggle works fine however if clicked anywhere else on the selected row, the icon toggles and then toggles back to its original state. It is like the item click event is firing twice in this instance.
It seems a pretty simple thing to achieve but have not been able to figure it out yet.
Any help is most appreciated.
Cheers
Jack
Listview Icon In Header
I have a listview in report view. I want to have an icon as one of the headers of the listview. I keep getting an error when I try to do this. What is the actual code to do this? I am using an imagelist to hold my icons.
Icon Positions In ListView
I am trying to save the icon positions in a listview control so that I can restore them the next time the application is open.
When I save the position, it works fine, however when I restore them, it sets each icon to the correct value but the LV controls moves everything over either to the left or top. I have made sure that the align property is set to none.
Any idea how to either get this to stop happening or work around it?
Shortcut Icon In Listview
Hi,
I have an app that lists all items on the Desktop into a listview and extracts their Icons(for the listview). But there is one problem: Shortcuts get their 'real' icon, instead of their icon with the little arrow in the lower left corner. (See images for example)
Does anyone know how to extract the correct icon AND get the arrow onto it?
Tnx.
This is what I get in my listview
This is what I want to get.
Listview Icon Problem
im using a listview control in report mode. i wish to add an icon to each item that gets listed on it. but whenever i try to, it says "Invalid Key". here is the code i tried to use:
frmSearch.lstResults.ListItems(frmSearch.lstResults.ListItems.Count).SmallIcon = frmSearch.il.ListImages(1).Key
thx for any help
Get The Index Of An Icon In Listview
Is there a way I can retrieve the index of an icon in listview?
I have a imagelist with 4 icons, I have no problem adding the icons to list view from the imagelist.
basically I need to be able to tell if the icon is an open or closed folder
my program really needs to check the icon type before I can process the Info in the listview.
can I retrieve the index or key of an icon in listview?
Thx for any help!
ListView, Icon And A Picture
I have an icon in a picturebox and want it as the icon in a listview. i have tried using ImageLists but i got nowhere. ANy help?
Center Icon In Listview
Hi,
I have a listview in report mode that displays Icons in the lists subitems columns. My problem is that the icons are always left aligned and I really need to center them.
Does anybody have any ideas on how to do this?
Thanks in advance
Totally
<?> Listview Icon View
Code:
'question:
'I load my listview and I use 2 different icons
'one for odd numbers, one for even. No Problem
'
I can then view my listview by LargeIcon,SmallIcon,List,Report
No Problem
However, when viewing largeicon I only get one icon
All the rest show me the 2 different icons.
There obviously is a reason...someone what to impart
that bit of knowledge on me.
'load an array with information
Dim myArr(99)
Dim i As Integer
For i = 1 To 99
myArr(i) = CInt(Rnd * 99)
Next i
'then load the array into a listview
Dim x As Variant 'differ between odd and even rows
For i = 1 To 99
'used different images every second line
'image one for odd, image2 for even
x = i / 2
If x Like "*.*" Then
Set sItem = Listview1.ListItems.Add(, , myArr(i), 1, 1)
Else
Set sItem = Listview1.ListItems.Add(, , myArr(i), 1, 2)
End If
'add subitems
sItem.SubItems(1) = "905-444-9455"
sItem.SubItems(2) = "who knows"
Next i
Icon In Each Row Of Listview Control
Hi,
Im looking for help for my current project.
Im using listview control to display some data from database. Here I want to put two different icons for two different type of record. For Example:
Sl.No: Name: Cleared:
======================
01. AAAAA Yes
02. BBBBB No
03. CCCCC Yes
This is the display. Here insted of "Yes" or "No", I want icons for each row.
It would be great help if any one can send sample/code to solve the problem.
Thanks in advance.
Koushik C.
Icon In Listview Control
I need to put an icon in a different column than the first one in a listview in report mode. Can anyone help?
bdiamond
ListView Must Use Two Icon Files?
Hey,
I just had an observation and was wondering if it's actually the case...
I had an icon file that had devices for 32x32 pixel and 16x16 pixel images. I wanted to use this icon file in a listview control, such that the same file could be used in the (2) imagelists for small and large icons. However, I could only get the listview to display the icons properly if I had two separate icon files, one with a 32x32 device and one with a 16x16 device. Is this always necessary, or is there someway to get the listview to look at the proper device in a single icon file? (It crudely scaled down the 32x32 image to get a 16x16 - my actual 16x16 looked much better). Just curious, it's not a big deal to make 2 icon files!
|