473,659 Members | 2,646 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.ControlPa int.DrawCheckBo x(e.Graphics, tempRectangle,
Windows.Forms.B uttonState.Chec ked)

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 1936
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.c om> wrote in message
news:um******** *****@TK2MSFTNG P12.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.ControlPa int.DrawCheckBo x(e.Graphics, tempRectangle,
Windows.Forms.B uttonState.Chec ked)

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.c om> wrote in message
news:um******* ******@TK2MSFTN GP12.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.ControlPa int.DrawCheckBo x
(e.Graphics, tempRectangle, Windows.Forms.B uttonState.Chec ked)

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*****@bluera ja.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
8332
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 checkboxes like this: chk1 chk1 chk1 But I need to name them with an array for deletion purposes which is already coded and working - I need to name them like this:
8
2834
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 is my code line that creates each checkbox (the php variable get
5
1803
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 user enters in the text boxes. do i need to group the checkboxes....hwo can i do that??? how to know which checkbox is checked because out of the 15 checkbox say 1,5,7, 9th are checked then i 1st need to get the id from the database adn then
1
3776
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 only 2 boxes clicked, and if another is selected nothing happens until one is unselected. I tried keeping track of how many were checked then turning off all the checkboxes, but that didn't seem right or allow changes. Also, if this could be done...
7
13627
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 tried with document.form_Name.ListBox_Name.options.selected =
3
6457
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 the socket is missing the last character (line feed). When the same text is sent without the urgent flag set, all of the characters are read. I'm reading the data using the blocking read call of the network stream class. The .NET...
3
1712
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 the code?Its very urgent Thanking u Rupa.
32
2774
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 some new ones on. In my code I am doing the following: For Each ctrl In tpMain.Controls If TypeOf (ctrl) Is CheckBox Then If ctrl.Name.StartsWith("chkS") Then ctrl.Visible = False
0
8428
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8339
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8751
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8629
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7360
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
2757
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.