Click here to Skip to main content
16,004,927 members
Home / Discussions / C#
   

C#

 
Questioncommunicate to usb with c# Pin
guy222216-Jan-07 0:56
guy222216-Jan-07 0:56 
AnswerRe: communicate to usb with c# Pin
ednrgc16-Jan-07 1:55
ednrgc16-Jan-07 1:55 
QuestionSOAP serializable. Pin
topcatalpha16-Jan-07 0:43
topcatalpha16-Jan-07 0:43 
AnswerRe: SOAP serializable. Pin
topcatalpha16-Jan-07 1:39
topcatalpha16-Jan-07 1:39 
Questioncopy array string to by byte array Pin
Jeeva Jose16-Jan-07 0:26
Jeeva Jose16-Jan-07 0:26 
AnswerRe: copy array string to by byte array Pin
goyal manish16-Jan-07 1:04
goyal manish16-Jan-07 1:04 
AnswerRe: copy array string to by byte array Pin
Guffa16-Jan-07 3:04
Guffa16-Jan-07 3:04 
QuestionComplex user control not responding to click events Pin
robalexclark15-Jan-07 23:40
robalexclark15-Jan-07 23:40 
Hi all,

I'm wondering whether any of you people can help me out with this problem that I have with a user control that I have been trying to get working.

The first part of the user control is a flat circular button ( called SampleButton) that toggles colour when clicked. This control has an OnClick method as follows

protected override void OnClick(EventArgs e)
{
base.OnClick(e);

(code to change colour and call invalidate....)
}



Then, from this I am creating a matrix of these buttons in another user control that inherits from SampleButton (which in turn inherits from UserControl), e.g. a 3 x 3 matrix, like so:

O O O

O O O

O O O

I do this using a couple of for loops (the number of SampleButtons has to be dynamic), a bit like:

for (int i = 0; i <= 2; i++)
{
for (int j = 0; j <= 2; j++)
{
SampleButton samBtn = new SampleButton();
samBtn.Location = new Point(i, j);

this.Controls.Add(samBtn);

}
}
}

In this control I have an OnClick method:

protected override void OnClick(EventArgs e)
{
base.OnClick(e);
MessageBox.Show("The Sample Button Array has been clicked");
}



The problem is that although when I click on the array of sample buttons, their colour changes (so the first OnClick method is running ok), the messagebox never appears (the method is never entered).

Why does this second OnClick method never get called?

Thanks,

Rob

AnswerRe: Complex user control not responding to click events Pin
Luc Pattyn16-Jan-07 0:12
sitebuilderLuc Pattyn16-Jan-07 0:12 
GeneralRe: Complex user control not responding to click events Pin
robalexclark16-Jan-07 1:05
robalexclark16-Jan-07 1:05 
GeneralRe: Complex user control not responding to click events Pin
Luc Pattyn16-Jan-07 1:51
sitebuilderLuc Pattyn16-Jan-07 1:51 
GeneralRe: Complex user control not responding to click events Pin
robalexclark16-Jan-07 3:29
robalexclark16-Jan-07 3:29 
Questionregular expression [modified] Pin
papy-boom15-Jan-07 23:39
papy-boom15-Jan-07 23:39 
AnswerRe: regular expression Pin
ednrgc16-Jan-07 2:07
ednrgc16-Jan-07 2:07 
GeneralRe: regular expression Pin
papy-boom16-Jan-07 2:16
papy-boom16-Jan-07 2:16 
GeneralRe: regular expression Pin
ednrgc16-Jan-07 2:41
ednrgc16-Jan-07 2:41 
Questionmultithreading and font object causes InvalidOperationException[modified] Pin
haape15-Jan-07 23:32
haape15-Jan-07 23:32 
QuestionCollapse Sections Pin
Blue_Boy15-Jan-07 23:23
Blue_Boy15-Jan-07 23:23 
QuestionHow to consume a webservice with a pocket pc emulator Pin
pshilviu15-Jan-07 23:15
pshilviu15-Jan-07 23:15 
Questionhttp web exception (C#.Net) Pin
Sri harini15-Jan-07 23:10
Sri harini15-Jan-07 23:10 
QuestionUTF-8 prefix in attachment filename Pin
mandrake_215-Jan-07 23:04
mandrake_215-Jan-07 23:04 
AnswerRe: UTF-8 prefix in attachment filename Pin
Guffa15-Jan-07 23:52
Guffa15-Jan-07 23:52 
GeneralRe: UTF-8 prefix in attachment filename Pin
mandrake_216-Jan-07 2:43
mandrake_216-Jan-07 2:43 
AnswerRe: UTF-8 prefix in attachment filename Pin
Guffa16-Jan-07 3:32
Guffa16-Jan-07 3:32 
QuestionOdbcDataAdapter query on update().. Pin
jamesjk15-Jan-07 22:56
jamesjk15-Jan-07 22:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.