Click here to Skip to main content
15,920,704 members
Home / Discussions / C#
   

C#

 
GeneralHex to Dec conversion (big numbas!) Pin
Blubbo19-Jul-04 4:06
Blubbo19-Jul-04 4:06 
GeneralRe: Hex to Dec conversion (big numbas!) Pin
Heath Stewart19-Jul-04 4:30
protectorHeath Stewart19-Jul-04 4:30 
GeneralEAP Certificate requests... Pin
Vodstok19-Jul-04 4:03
Vodstok19-Jul-04 4:03 
GeneralRe: EAP Certificate requests... Pin
Heath Stewart19-Jul-04 4:42
protectorHeath Stewart19-Jul-04 4:42 
GeneralRegular Expressions Pin
Anonymous19-Jul-04 3:54
Anonymous19-Jul-04 3:54 
Questionhow do I get the cursor position?? Pin
Stephan Wright19-Jul-04 1:31
Stephan Wright19-Jul-04 1:31 
AnswerRe: how do I get the cursor position?? Pin
misterbear19-Jul-04 2:07
misterbear19-Jul-04 2:07 
GeneralRe: how do I get the cursor position?? Pin
Stephan Wright19-Jul-04 2:19
Stephan Wright19-Jul-04 2:19 
Yup, I had this one, but the result was quit strange, because the context appeared around as far from the cursor as the cursor was located rom the upper left corner of my application window! Meaning the upper left corner of the context was twice the distance of the mouse distance of the left corner of the application.

Do you have an idea why?
Because I also tried Control.MousePosition.
Same result!
Because I can't find out why!

And a second question: When selecting one of the MenuItems I do want the selected one to being placed in the TextBox the Context "belongs" to. But to do so, I do have to create an eventhandler for the clickevent, but then I do loose access to my TextBox.

Well it looks like this:
....
System.Windows.Forms.ContextMenu ctNameKeyMenu;
ctNameKeyMenu = new System.Windows.Forms.ContextMenu();
System.Windows.Forms.MenuItem menuItem1;
menuItem1 = new System.Windows.Forms.MenuItem();
System.Windows.Forms.MenuItem menuItem2;
menuItem2=new System.Windows.Forms.MenuItem();

ctNameKeyMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {menuItem1, menuItem2});
menuItem1.Index=0;
menuItem1.Text=ltemparray[1].ToString();
menuItem1.Click += new System.EventHandler(this.menuItem1_Click();

menuItem2.Index=1;
menuItem2.Text=ltemparray[2].ToString();
menuItem2.Click += new System.EventHandler(this.menuItem2_Click);

ctNameKeyMenu.Show(lTextBox, Control.MousePosition);

.....

// same for menuItem2
private void menuItem1_Click(object sender, System.EventArgs e)
{
// assign the selected item of the context to the TextBox
}

But in the Clickevent section my TextBox is no longer accessible. So how do I get it in there? The selected item is available in the sender object, but this doesn't really help much.

Thanks again!
Stephan.
GeneralRe: how do I get the cursor position?? Pin
Heath Stewart19-Jul-04 3:18
protectorHeath Stewart19-Jul-04 3:18 
GeneralRe: how do I get the cursor position?? Pin
Stephan Wright19-Jul-04 3:53
Stephan Wright19-Jul-04 3:53 
Questionhow to get the supported cryptographic algorithm on current .net platform Pin
noosword18-Jul-04 23:54
noosword18-Jul-04 23:54 
AnswerRe: how to get the supported cryptographic algorithm on current .net platform Pin
Heath Stewart19-Jul-04 2:39
protectorHeath Stewart19-Jul-04 2:39 
GeneralQuestion abt service Pin
SatyaDY18-Jul-04 23:51
SatyaDY18-Jul-04 23:51 
GeneralRe: Question abt service Pin
RB@Emphasys19-Jul-04 6:44
RB@Emphasys19-Jul-04 6:44 
GeneralReferences controls created at runtime Pin
JKtracksub418-Jul-04 21:41
JKtracksub418-Jul-04 21:41 
GeneralRe: References controls created at runtime Pin
Heath Stewart19-Jul-04 2:51
protectorHeath Stewart19-Jul-04 2:51 
GeneralCast Problem Pin
Reinier van de Wetering18-Jul-04 21:28
Reinier van de Wetering18-Jul-04 21:28 
GeneralRe: Cast Problem Pin
mav.northwind18-Jul-04 21:47
mav.northwind18-Jul-04 21:47 
GeneralRe: Cast Problem Pin
Reinier van de Wetering18-Jul-04 22:16
Reinier van de Wetering18-Jul-04 22:16 
GeneralRe: Cast Problem Pin
RB@Emphasys19-Jul-04 6:48
RB@Emphasys19-Jul-04 6:48 
QuestionCrystal Reports: Bad performance on some Win2000 systems? Pin
Pain_Elemental18-Jul-04 18:05
Pain_Elemental18-Jul-04 18:05 
AnswerRe: Crystal Reports: Bad performance on some Win2000 systems? Pin
Daniel Turini19-Jul-04 6:09
Daniel Turini19-Jul-04 6:09 
GeneralRe: Crystal Reports: Bad performance on some Win2000 systems? Pin
Pain_Elemental19-Jul-04 20:57
Pain_Elemental19-Jul-04 20:57 
GeneralProblem with Stored Procedure's Return value Pin
ronin177018-Jul-04 15:23
ronin177018-Jul-04 15:23 
GeneralRe: Problem with Stored Procedure's Return value Pin
woudwijk18-Jul-04 21:19
woudwijk18-Jul-04 21:19 

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.