Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi there

 

I guess I'm trying to be too clever, but I wonder if someone can shed some light on what is happening.

 

I'm loading a combobox with a number of thousands of items. To speed the process up I've tried to use:

SendMessage(ComboBox1.Handle, CB_ADDSTRING, -1, "Some Text")

 

However things don't appear well. The list gets populated, but when clicking on an item in the list I get a subscript error. The dropdown box also only appears to be one line rather than 8.

 

I can go back to useing the combobox.add method, but I'm curious as to what is going on. Any thoughts anyone.

 

Thanks.

  • Leaders
Posted

well , the 3rd parameter should be a zero , not -1 so try ...

SendMessage(ComboBox1.Handle, CB_ADDSTRING, [color=Red][b]0[/b][/color], "Some Text") '/// note i've replaced the [b]-1[/b] with [b]0[/b]

Posted
well , the 3rd parameter should be a zero , not -1 so try ...

SendMessage(ComboBox1.Handle, CB_ADDSTRING, [color=Red][b]0[/b][/color], "Some Text") '/// note i've replaced the [b]-1[/b] with [b]0[/b]

 

Thanks

 

I did try that in an earlier attempt but it gave the same results. The error I get is "Specified arguement was out of range of valid values. Parameter name '48' is not a valid value for 'index'.

Posted

Digging around a little more I found the comment that Sendmessage deals with "objects" whereas the framework expects "strings". I guess this is the problem. I'm back to the slower but more orthodox add function.

 

Thanks for your help.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...