|
-
Oct 1st, 2000, 11:12 AM
#1
Thread Starter
Frenzied Member
Hi,
I ran into a problem when using a ListView and when an item is selected, and when you pop up a msgbox via the menu and close the msgbox, the selected item in the ListView flickers.
I would appreciate if you could follow the example below to see if you can re-create the problem.. Then, maybe we can all work towards a resolution or find out if it's a known bug from Microsoft.
Instructions:
1) Create a form with a listview and a menu item named mnuTest with a caption of "Test".
2) Copy the following code into the form's module.
Code:
Private Sub Form_Load()
Dim l As Integer
'-- load listview properties
With ListView1
.View = lvwReport
.HideSelection = True
.FullRowSelect = True
.LabelEdit = lvwManual
.MultiSelect = True
End With
'-- load columns
With ListView1
.ColumnHeaders.Clear
.ColumnHeaders.Add , , "Col1", 1500
.ColumnHeaders.Add , , "Col2", 1500
.ColumnHeaders.Add , , "Col3", 1500
.ColumnHeaders.Add , , "Col4", 1500
.ColumnHeaders.Add , , "Col5", 1500
.ColumnHeaders.Add , , "Col6", 1500
.ColumnHeaders.Add , , "Col7", 1500
.ColumnHeaders.Add , , "Col8", 1500
.ColumnHeaders.Add , , "Col9", 1500
End With
'-- populate list with data
With ListView1.ListItems
For l = 1 To 1000
With .Add(, , "test")
End With
Next l
End With
End Sub
Private Sub mnuTest_Click()
MsgBox "test"
End Sub
3) Run the project and make sure that an item is selected, then hit the "Test" menu item.
As soon as you close out the msgbox by hitting OK, the focus should go back to the selected item and it should flicker a few times.
I would appreciate if you could let me know if you experience this same problem or not. If so, do you have any ideas as to what it might be and what the resolution might be? What's weird is that when you compile the project and run it, the flickering is reduced, but still present.
I wanted to see if this was phenomenom was standard to the ListView's operation so I did a test with Windows Explorer. I selected an item in "report view" and then hit the delete key. The msgbox popped up and I hit cancel. The focus was release backed to the selected item but no flickering occured.. So, it seems that this problem should not be occuring.. I'm using VB6 with SP3 but have tested it on 3 other machines which do not have SP3 and I have the same problem..
Any and all help would be immensley appreciated..
Dan
-
Oct 1st, 2000, 11:43 AM
#2
Addicted Member
Hi,
It does it in VB6 (SP4) too. I'll have a play around with it to see if it can fixed and let you know if it can 
Web/Application Developer
VB6 Ent (SP5), Win 2000,SQL Server 2000
-
Oct 1st, 2000, 01:18 PM
#3
Thread Starter
Frenzied Member
Well, I just found a work around.. Instead of using a MsgBox, create your own message box using a form and opening it with vbModal to simulate a msgbox...
Must be something in the MsgBox code that's causing the problem.. strange...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|