473,386 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Urgent help needed with Checkboxes

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
4 1922
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
-----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
"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ralph Freshour | last post by:
I have a function that I call to check or uncheck all checkboxes on a form - I use a 'master' checkbox to do this much like hotmail has to check all mail messages - the code works fine if I name my...
8
by: Ralph Freshour | last post by:
I have multiple checkbox's created with an array name because I have many on the same web page - their names are like: frm_chk_delete frm_chk_delete frm_chk_delete frm_chk_delete etc. Here...
5
by: VbUser25 | last post by:
hi i need urgent responses.. i have some 15 checkboxex on a form... i want to 1st check the no. of checkboxes that are checked?? and then loop it that many times adn insert the quantities the...
1
by: Patrick | last post by:
Hello - I am designing a form that only allows 2 checkboxes to be checked out of a series of checkboxes. However, checkedchanged and checkstatechanged both act when the box is clicked on. I want...
7
by: deepagulati | last post by:
Hi, I need an urgent help from you. When we dynamically genrate any list box (Select Box) it shows one default value as selected. Is there any way that we can deselect that value. I...
3
by: N. Spiker | last post by:
I am attempting to receive a single TCP packet with some text ending with carriage return and line feed characters. When the text is send and the packet has the urgent flag set, the text read from...
3
by: snowrupa | last post by:
Hi, I am having 2 grids in my form.I am binding the records through object Data Source.main grid is with checkboxes .So I want to copy the checked items into another Gridview? Can anyone give me...
32
by: =?Utf-8?B?U2l2?= | last post by:
I have a form that I programmatically generate some check boxes and labels on. Later on when I want to draw the form with different data I want to clear the previously created items and then put...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.