|
-
Sep 29th, 2000, 11:32 AM
#1
Thread Starter
Frenzied Member
Hi,
There seems to be a problem when an item is selected in a ListView and on
that same form, if you launch a MsgBox and then when it closes, the selected
item flickers about 3 times..
I guess it has something to do with when the focus is released from the MsgBox after
it closes, and it goes back to the selected item, it causes this flicker problem..
You can test and verify this by creating a form with a listview. Add just a single item, select it and hit a command button which pops up a msgbox. As soon as you close the msgbox,
you should see that the selected item flickers..
Does anyone have a fix for this? It looks too cheesy to release to my end users in this state..
Thanks,
Dan
-
Sep 29th, 2000, 04:39 PM
#2
Addicted Member
I could not reproduce the problem you are having on an NT SP6,VS6 SP3. I tested it with both the common controls 5 and 6 listview controls.
Was there any other setup on the listview you tested(like HotTracking)?
What is your current configuration(service packs/versions)?
-
Sep 30th, 2000, 06:14 AM
#3
Well ...
I, too, haven't seen the flicker with the ListView. And I am using many listviews in my project along with a host of other controls such as grids, radio buttons and command buttons. I am using Win 98 VB6 SP3.
dbassettt74, Is there some code that you are executing in the GotFocus or ItemClick or some such event of the Listview control?
-
Sep 30th, 2000, 10:25 PM
#4
Thread Starter
Frenzied Member
Okay guys, I started from scratch in an effort to duplicate my problem because there were far too many things I had going on in my original project that couldn't caused the problem..
I was able to duplicate it. It seems that the problem is a combination of having more than a few columns and more than a few items. When I have just 1 column and 1 item, no flicker occurs. But, when I have hundreds of items and about 8 columns, the flicker does occur.
But what's interesting is when I compile it, the flickering is reduced, but not eliminated..
See if you can duplicate the problem following my instructions below so that maybe we can see if we can find a resolution. I have been able to duplicate this problem on 3 different machines.
Create a form with a listview and 1 menu item named mnuTest. Paste the following code in the form's module and run it. Make sure an item is selected. Click the menu item and hit okay on the msgbox. Once the msgbox closes, focus should be sent back to the selected item and flickering should occur..
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
Any help on solving this problem would be appreciated..
Dan
-
Oct 1st, 2000, 01:06 PM
#5
Addicted Member
Yes, that is a problem. I don't have an answer as to why, but I found a work around.
Add an extra form to your project and use it instead of the msgbox. Call it modally so that it forces the user to make a descision before any other process in your application can run. Be sure to unload the form when your done with it.
Form2.Show vbModal
Hope this helps, good luck!
-
Oct 1st, 2000, 01:16 PM
#6
Thread Starter
Frenzied Member
Yep, that did it!! I just discovered this myself and was going to post it but you beat me to it!
Strange problem, huh? Must be something to do with the code behind the MsgBox function..
Ohwell, glad we found a work around..
Dan
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
|