473,387 Members | 1,535 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,387 software developers and data experts.

mouse click event missing in groupBox control

Hi,
in my windows.forms application I have added a goupBox control to my
windows.form.

Now I want to know the x,y-position from the mouse cursor when I click on
the groupBox.
The strange thing is that the mouse click event does not exist.

Does anyone know how to get teh x,y position of the mouse cursor when you
click in a groupbox control ?
Simply using the mouseclick event from the form does not work because the
event is never fired.

Regards, Serge
Nov 16 '05 #1
2 18713

"Serge" <se***@NOSPAM.com> wrote in message
news:41***********************@news.skynet.be...
Hi,
in my windows.forms application I have added a goupBox control to my
windows.form.

Now I want to know the x,y-position from the mouse cursor when I click on
the groupBox.
The strange thing is that the mouse click event does not exist.

Does anyone know how to get teh x,y position of the mouse cursor when you
click in a groupbox control ?
Simply using the mouseclick event from the form does not work because the
event is never fired.

Regards, Serge

You can code one for yourself, even though the Click is not listed in the
events list for a GroupBox.
Use a generated event procedure shell, such as the shell for the Enter event
and change it as follows:

private void groupBox1_Click(object sender, System.EventArgs e)

{

MessageBox.Show("The click event!");

}

You'll also have to edit the entry in the InitializeComponent method for the
enter event to something like this:

this.groupBox1.Click += new System.EventHandler(this.groupBox1_Click);

Works for me.

--
Peter [MVP Visual Developer]
Jack of all trades, master of none.
Nov 16 '05 #2
great ! it works .
I did not realize it was that simple.

Thanks VERY much for your help,
regards, Serge

"Peter van der Goes" <p_**********@toadstool.u> wrote in message
news:eb****************@TK2MSFTNGP09.phx.gbl...

"Serge" <se***@NOSPAM.com> wrote in message
news:41***********************@news.skynet.be...
Hi,
in my windows.forms application I have added a goupBox control to my
windows.form.

Now I want to know the x,y-position from the mouse cursor when I click on the groupBox.
The strange thing is that the mouse click event does not exist.

Does anyone know how to get teh x,y position of the mouse cursor when you click in a groupbox control ?
Simply using the mouseclick event from the form does not work because the event is never fired.

Regards, Serge

You can code one for yourself, even though the Click is not listed in the
events list for a GroupBox.
Use a generated event procedure shell, such as the shell for the Enter

event and change it as follows:

private void groupBox1_Click(object sender, System.EventArgs e)

{

MessageBox.Show("The click event!");

}

You'll also have to edit the entry in the InitializeComponent method for the enter event to something like this:

this.groupBox1.Click += new System.EventHandler(this.groupBox1_Click);

Works for me.

--
Peter [MVP Visual Developer]
Jack of all trades, master of none.

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: John Dann | last post by:
This question has arisen from an earlier thread but is really a separate issue: I have a VB.Net listbox control on a form. I want to be able to do 2 things with items displayed within the one...
3
by: Ryan Liu | last post by:
Can someone give a sample to prevent a row from being deleted in a datatable? I tried e.Row.RejectChanges(); in dt_RowDeleting() but seems does not work. I need verify if there other data...
7
by: RobKinney1 | last post by:
The subject line sounds a little funny, let me quickly explain: I have created a custom control using ComboBox. But inside my class, I need to know when the user does NOT click my control. Of...
4
by: Pucca | last post by:
How can I tell a mouse right clicks over a listview item that's in a container panel. I only want to display a popup menu if the user right click the mouse over an item on the Listview. I don't...
2
by: TC | last post by:
Hello, I need to build a very simple text editor. The requirement is that the input screen should be divided into 'm*n' cells ('m' rows, 'n' columns, with each cell of a fixed size). Whenever...
5
by: moonie | last post by:
I have an msn style c# windows application with a form and panel on it. A news list is drawn from the database and dynamically added via labels, link lables during form loading. In this...
1
by: antani | last post by:
I have a groupbox in my application that contains many control as NumericUpDown and CheckBox. I would like capture event on groupbox control as changing NumericUpDown value and checkbox change ....
4
by: =?Utf-8?B?Unlhbg==?= | last post by:
I have a winform containing a scrollable panel and a groupbox inside the panel. There is a button inside the groupbox. When that button is clicked; how do I capture and display the X and Y...
1
by: john ciriello | last post by:
Hi, is there an easy way to detect when the mouse pointer enters a disabled button? For example I have a button I can see but it is greyed out. When the mouse moves over it I would like to be able...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.