|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
Im sure this bug has been found by other developers, but I still havent found a solution. A brief synopsis of the circumstances causing the error follows: 1. Populate a Combobox (for the sake of a test keep it between 15 and 30). This can be done on the form load event 2. Drop the list to display the items. This list must remain displayed from here on. When you drop the list, enable a timer perform step 3: 3. Remove Items from the list one by one over a given period of time using a timer (around 10 seconds for example) until the list count is zero. The result is a paint problem where the last few items of the list still remain visible on the screen as the Combo Box does not repaint the area where the list is. Obvious solutions would be to repaint or refresh the screen, but im not sure of what API calls do this. Ive also tried automatically moving the form (Form.Move()) off the screen and back to its original position in an instant. This works, but is a messy solution as it does not repaint the screen where the list has exceeded the height of the form. For the sake of my application that I am developing, it is required that I must have the ComboBox list displayed whilst removing items, so I have to solve this one. Any fixes or solutions would be helpful. Many Thanks Roy Sample code requiring a timer and a combobox can be run below. All you have to do is drop the list to start the test: 'Combo Box Paint Bug. 'VB6, Service Pack 5, Windows 2000 'Run and drop the list to start the test. Wait until Private Sub Form_Load() Dim iIndex As Integer 'Set some form dimensions to make sure the list exceeds the height of the form Me.Height = 1000 Me.Width = 3000 Me.Caption = "Drop the Combo Box" With Combo1 'Tidy up the position of the ComboBox .Top = 30 .Left = 30 .Width = 2000 'Add some of the letters of the alphabet For iIndex = 64 To 78 .AddItem Chr(iIndex) Next iIndex End With End Sub Private Sub Combo1_Change() 'Enable the timer to start removing items upon displaying the list Timer1.Enabled = True Me.Caption = "Test Started" End Sub Private Sub Timer1_Timer() Dim iIndex As Integer If Combo1.ListCount = 0 Then 'If there are no items left in the list, disable the timer. Timer1.Enabled = False Me.Caption = "Test Completed" Exit Sub End If Combo1.RemoveItem 0 End Sub |
|
#2
|
|||
|
|||
|
May be this helps...
Why don't U use .Refresh Method? Code:
Private Sub Timer1_Timer() Dim iIndex As Integer If Combo1.ListCount = 0 Then 'If there are no items left in the list, disable the timer. Timer1.Enabled = False Me.Caption = "Test Completed" Exit Sub End If Combo1.RemoveItem 0 Combo1.Refresh End Sub
__________________
I May Have Misinterpret U'r Post Correct Me If I Am Wrong......// Enjoy Coding........................../// zak2zak |
|
#3
|
|||
|
|||
|
No! zak2zak! It's Not useful!
Maybe is a big bug about ComBoBox. |
|
#4
|
|||
|
|||
|
I get similar results on XP Pro SP1 and VB6 SP5. It looks like a bug to me too
![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Possibly Unkown Combo Box Bug in VB6 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|