Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have this test to see which control the contex menu pops up for but the problem is that it works for labels but not for Rich text boxes. In other words, when I right click on a text box no control is displayed in the messagebox but for labels it does.

 

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

{

MessageBox.Show(""+this.contextMenu1.SourceControl);

}

 

Is that normal? I have in VSC# the Context menu section set to the same context menu for both.

C#
  • 2 weeks later...
Posted (edited)

Please answer this, I am having much trouble figuring out why it works for labels and not for the text boxes.

 

Also, you might want to know that when I do right click on a label the messagebox shows it is a label with the text property and when I right click on a textbox after that there is something in the messageBox but it is the label info.

 

However, this method works: this.RTB1.Copy(); What did I do wrong?

Edited by aewarnick
C#
Posted

I got the context menu to work for rtb's but it still does not show any source control here:

 

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

{

MessageBox.Show(""+this.contextMenu1.SourceControl);

}

 

Does anyone know why?

C#

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...