By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,474 Members | 939 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,474 IT Pros & Developers. It's quick & easy.

Urgent help needed with Checkboxes

P: n/a
Here's a tricky question..:)

I have a a function in a webform that will draw a checkbox in a given area
(note, this is an override of a PaintForeground function, not a drop / drag
of a checkbox from the toolbar).
System.Windows.Forms.ControlPaint.DrawCheckBox(e.G raphics, tempRectangle,
Windows.Forms.ButtonState.Checked)

It's draw in a cell within a grid. I use an AddHandler function to call a
function (Call it Function X) when the cell is clicked. I have also
overridden the onclick function of the cell to redraw the checkbox as
clicked or unclicked, depending on what the previous value was.

The problem is that Function X is called twice each time I click the cell. I
have *throughly* reviewed the code to make sure that I haven't added two
handlers. I have not been.Despite this, a stack trace does seem to indicate
there are two handlers, though my assembly is not so good.

When I draw a checkbox, does it automaticially add a handler? And does that
handler "bubble" up to the cell? If so, can this be prevented? Thank you in
advance.

-J
Nov 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
I had the same problem with another issue, not checkboxes, but I set a flag
(not the best...) that said it was already clicked. And then when it
finished processing, it reset the flag.

May or may not help.. I dunno.

-CJ
"Joe Kasta" <J@microkroff.com> wrote in message
news:um*************@TK2MSFTNGP12.phx.gbl...
Here's a tricky question..:)

I have a a function in a webform that will draw a checkbox in a given area
(note, this is an override of a PaintForeground function, not a drop / drag of a checkbox from the toolbar).
System.Windows.Forms.ControlPaint.DrawCheckBox(e.G raphics, tempRectangle,
Windows.Forms.ButtonState.Checked)

It's draw in a cell within a grid. I use an AddHandler function to call a
function (Call it Function X) when the cell is clicked. I have also
overridden the onclick function of the cell to redraw the checkbox as
clicked or unclicked, depending on what the previous value was.

The problem is that Function X is called twice each time I click the cell. I have *throughly* reviewed the code to make sure that I haven't added two
handlers. I have not been.Despite this, a stack trace does seem to indicate there are two handlers, though my assembly is not so good.

When I draw a checkbox, does it automaticially add a handler? And does that handler "bubble" up to the cell? If so, can this be prevented? Thank you in advance.

-J

Nov 20 '05 #2

P: n/a
-----Original Message-----
I had the same problem with another issue, not checkboxes, but I set a flag(not the best...) that said it was already clicked. And then when itfinished processing, it reset the flag.

May or may not help.. I dunno.

-CJ
"Joe Kasta" <J@microkroff.com> wrote in message
news:um*************@TK2MSFTNGP12.phx.gbl...
Here's a tricky question..:)

I have a a function in a webform that will draw a checkbox in a given area (note, this is an override of a PaintForeground function, not a drop /
drag
of a checkbox from the toolbar).
System.Windows.Forms.ControlPaint.DrawCheckBox
(e.Graphics, tempRectangle, Windows.Forms.ButtonState.Checked)

It's draw in a cell within a grid. I use an AddHandler function to call a function (Call it Function X) when the cell is clicked. I have also overridden the onclick function of the cell to redraw the checkbox as clicked or unclicked, depending on what the previous value was.
The problem is that Function X is called twice each time I click the cell.I
have *throughly* reviewed the code to make sure that I
haven't added two handlers. I have not been.Despite this, a stack trace does seem toindicate
there are two handlers, though my assembly is not so
good.
When I draw a checkbox, does it automaticially add a

handler? And doesthat
handler "bubble" up to the cell? If so, can this be
prevented? Thank youin
advance.

-J

.

Nov 20 '05 #3

P: n/a
"Joe Kasta" <no*****@blueraja.net> scripsit:
[Some really ugly fullquotes]

Problem solved?!

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #4

P: n/a
Hi Herfried,

Isn't it annoying when the response is in the message title and the body is
full of garbage!

Regards,
Fergus
Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.