Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 268
  • Last Modified:

Combo box List items become squares?

I have a dropdown combo box, populated by these values in the List property of the control:

-2
-1
0
+1
+2

When I remove -2 and -1, then re-examine the list contents, the 0 becomes an empty square character.  In fact, any other entry that I change becomes one of these characters.  I can't seem to cut-and-paste it here, but you've likely seen the character I'm referring to.  

What gives?
0
cphansen
Asked:
cphansen
  • 6
  • 4
  • 2
  • +1
2 Solutions
 
cphansenAuthor Commented:
There's the character!  Where the hell did they come from?  My paste attempts?  Now I'm confused.
0
 
cphansenAuthor Commented:
Wow, it would appear my computer is at fault here.  I'm getting all kinds of anomalies when typing this reply.  I've rebooted to no effect for the problem in question.  Could it be my Windows install?
0
 
dbrckoviCommented:
Hi!

Can you answer this?

 - create a combobox, and paste this code:
'----------------------------------------------------
Private Sub Form_Load()
    Dim Item As String
   
    Combo1.Clear
    For x = -2 To 2
        Combo1.AddItem x
    Next x

    Me.Show

    For x = 0 To Combo1.ListCount - 1
        Item = Combo1.List(x)
        For Char = 1 To Len(Item)
            Print Asc(Mid(Item, Char, 1))
        Next Char
    Next x
End Sub
'-----------------------------------------------------------

When you run it, what do you get?
You should get these results on the left side of your form:
45  -
50  2
45  -
49  1
48  0
49  1
50  2


Are you getting the same results?
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
dbrckoviCommented:
If you remove first two items like this:

'--------------------------------------------
Private Sub Form_Load()
    Dim Item As String
   
    Combo1.Clear
    For x = -2 To 2
        Combo1.AddItem x
    Next x

    Combo1.RemoveItem 0
    Combo1.RemoveItem 0

    Me.Show

    For x = 0 To Combo1.ListCount - 1
        Item = Combo1.List(x)
        For Char = 1 To Len(Item)
            Print Asc(Mid(Item, Char, 1)) & "   " & Mid(Item, Char, 1)
        Next Char
    Next x
End Sub
'---------------------------------------------
you should get:

48  0
49  1
50  2
0
 
Erick37Commented:
Sounds like you have a hardware issue since the problem happened in your first post as well.  Perhaps when you cut and paste.

Those characters are:

debug.print Asc("") = 1
 
    and

Const vbKeyLButton = 1

Maybe your mouse and / or keyboard need a vacation.  Can you swap out the keyboard/mouse to eliminate that as the cause?
0
 
dbrckoviCommented:
Actualy almost all ascii codes from 0 to 31 are represented as "", or something similar depending on the font.

For example: None of these squares have the same ascii code. (Or atleast they shouldn't if they are saved as I posted them)

      


0
 
Erick37Commented:
Yes, but the characters in the question are 1's

"What gives?" <---- all 1's
0
 
dbrckoviCommented:
You're right.
I just wanted to state that there are more ascii codes which are represented with a square.
I didn't mean to oppose to your comment, but to expand it.
0
 
dbrckoviCommented:
Anyway.

I'd like to suggest few more things that might help:

 - Maybe your font's are scrambled in some way. Try reinstalling them or using different fonts.
 - If your keyboead leayout is not set to English, try setting it to Englsih, or try setting all regional settings to your language/country
 - Try running a virus scan. Maybe you picked up some virus which scrambles your characters. http://housecall.antivirus.com/
 - Maybe it's hardware problem. Try swapping your keyboard as Erick37 suggested, or if you don't have another keyboard available try using On Screen Keyboard program:        Start -> Run -> type:  "osk"
            If the problem is solved using osk, then buy new keyboard.
 - If you have them available, try using different type of keyboard (USB, PS2)

 - If nothing else helpes, then first try to repair your Windows installation
 - If this won't help either, do a fresh reinstall
0
 
AjithJoseCommented:
Definitely font problem: Try changing the .Font property of combo box
0
 
dbrckoviCommented:
We can't know if some answer was correct becouse, after asking the qustion, author didn't respond.
We don't even know if it's hardware or software problem, but I'm sure Erick37's and my suggestions would solve it, so I suggest a split.
0
 
cphansenAuthor Commented:
My apologies.  I don't usually leave questions hanging.  I shelved this problem for a little while, as the problem is not a large concern, and more pressing matters have taken me away from this one.

I will get back to this today.

Craig
0
 
cphansenAuthor Commented:
Took another look at it.  The problem is gone.  The install is the same.  The keyboard is the same.  No fonts were changed.  No virus was found. I use NOD32, scan weekly, and have been since before this problem was posted.

I'm at a loss as to why, but at least it works.

I'll split the points across the board.  I guess this was just a weird one.

Craig

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 6
  • 4
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now