|
-
May 7th, 2003, 05:37 AM
#1
Thread Starter
Addicted Member
Repaint control ?
This si my problem: I have checkedlistbox with about 25 items, when I need to check some items from code like this
For i = 0 To chklstbox.Items.Count - 1
chklstbox.SelectedIndex = i
if condition then chklstbox.SetItemChecked(i, True)
Next i
control flicker on the screen. Question is how to avoid that flickering?
In vb6 some controls (like msflexgrid) have property 'Redraw', when it's set to false controls don't redraw on the screen when some changes are perform.
regard j
-
May 7th, 2003, 06:58 AM
#2
yay gay
i dont thing the best way to do taht is putting "chklstbox.SelectedIndex = i"..althogu i've never used that control there should be another way to loop thru all the items of the listbox or not?
\m/  \m/
-
May 7th, 2003, 08:39 AM
#3
Thread Starter
Addicted Member
PT Exorcist said:
i've never used that control there should be another way to loop thru all the items of the listbox or not?
Did anybody know that 'another way'?
regard j
-
May 7th, 2003, 08:46 AM
#4
Try this
VB Code:
[b]chklstbox.BeginUpdate[/b]
For i = 0 To chklstbox.Items.Count - 1
chklstbox.SelectedIndex = i
if condition then chklstbox.SetItemChecked(i, True)
Next i
[b]chklstbox.EndUpdate[/b]
This world is not my home. I'm just passing through.
-
May 7th, 2003, 08:51 AM
#5
Thread Starter
Addicted Member
I tried, that doesn't work.
regard j
-
May 7th, 2003, 09:37 AM
#6
ok then, try this.
VB Code:
Dim i As Integer
Dim clb As New CheckedListBox()
Dim bln As Boolean
Cursor.Current = Cursors.WaitCursor
chklstbox.BeginUpdate()
For i = 0 To chklstbox.Items.Count - 1
clb.Items.Add(chklstbox.Items(i))
Next
chklstbox.Items.Clear()
For i = 0 To clb.Items.Count - 1
bln = CBool(i Mod 3 = 1) 'condition
chklstbox.Items.Add(clb.Items(i), bln)
Next
chklstbox.EndUpdate()
Cursor.Current = Cursors.Default
This world is not my home. I'm just passing through.
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
|