Re: Adding an item to a Checked List Box
by johnei » Sun, 18 Apr 2004 01:48:45 GMT
i, Simon
I think it really depends on whether your first priority is getting it
working or figuring out what happened. In the former case I would recreate
the for in a new project, pasting your code ONLY from the old to the new.
If that works, dive into the form designer code and look for differences.
If you have to know what happened, try pealing the onion. Chop away what
should be irrelevant code and controls is small chunks until things start
working. Put the last piece back and see if it fails. Then go over the 2
files with a fine tooth comb. Something should be obvious.
Hope this helps,
John Eikanger
Microsoft Developer Support
This posting is provided S ISwith no warranties, and confers no rights.
--------------------
| From: "Simon Jefferies"<< XXXX@XXXXX.COM >>
| Subject: Re: Adding an item to a Checked List Box
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| Thanks for your reply,
|
| When I created a new project it worked! Mmmm...
|
| I haven't touched the Windows Form designer generated code section.
|
| Any ideas on what to try next?
|
| Regards
| Simon Jefferies
| Tools Programmer, Headfirst Productions
| mailto: XXXX@XXXXX.COM
| www.headfirst.co.uk www.callofcthulhu.com
| -
| "John Eikanger [MSFT]"<< XXXX@XXXXX.COM >> wrote in message
| news: XXXX@XXXXX.COM ...
|>> Hi, Simon
|>>
|>> I can't get it to repro here either.
|>>
|>> What happens when you start a new project, add a checked list box & a
|>> button, and put your code in the button's click event? If that works,
|>> there is probably something wrong in your form or project files. Have
you
|>> edited the code in the Windows Form Designer generated code section?
That
|>> could be the culpret. If the simple project fails, please zip up the
|>> simple project and attach it to a post. That will give us something
real
|>> to play with.
|>>
|>> Hope this helps,
|>>
|>> John Eikanger
|>> Microsoft Developer Support
|>>
|>> This posting is provided "AS IS" with no warranties, and confers no
|>> rights.
|>> --------------------
|>> | From: "Simon Jefferies"<< XXXX@XXXXX.COM >>
|>> | Subject: Re: Adding an item to a Checked List Box
|>> | Date: Thu, 15 Apr 2004 15:57:44 +0100
|>> | X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|>> |
|>> | I don't get an exception when I comment out the BeginUpdate, Clear and
|>> | EndUpdate.
|>> |
|>> | I put back in the Clear() and its still working, so it means
|>> BeginUpdate()
|>> | or EndUpdate() or both causes this problem?
|>> |
|>> | Yes, I am performing this in the main application thread.
|>> |
|>> | Why would this happen?
|>> |
|>> | --
|>> | Regards
|>> | Simon Jefferies
|>> | Tools Programmer, Headfirst Productions
|>> | mailto: XXXX@XXXXX.COM
|>> | www.headfirst.co.uk www.callofcthulhu.com
|>> | -
|>> | "Herfried K. Wagner [MVP]"<< XXXX@XXXXX.COM >> wrote in message
|>> | news: XXXX@XXXXX.COM ...
|>> |>> Simon,
|>> |>>
|>> |>> * "Simon Jefferies"<< XXXX@XXXXX.COM >> scripsit:
|>> |>>> clbWaves.BeginUpdate()
|>> |>>> clbWaves.Items.Clear()
|>> |>>> Try
|>> |>>> clbWaves.Items.Add("Hello", True)
|>> |>>> Catch ex As Exception
|>> |>>> End Try
|>> |&g