Click here to Skip to main content
15,913,854 members
Home / Discussions / C#
   

C#

 
GeneralRe: Repainting window. Pin
Nick Z.8-Jul-04 17:00
Nick Z.8-Jul-04 17:00 
GeneralRe: Repainting window. Pin
Heath Stewart8-Jul-04 17:08
protectorHeath Stewart8-Jul-04 17:08 
GeneralRe: Repainting window. Pin
Nick Z.8-Jul-04 17:51
Nick Z.8-Jul-04 17:51 
GeneralA far more superior solution. Pin
Nick Z.8-Jul-04 18:54
Nick Z.8-Jul-04 18:54 
General"contexMenu" in "TreeView" for specific "Node". Pin
novitzky8-Jul-04 9:50
novitzky8-Jul-04 9:50 
GeneralRe: "contexMenu" in "TreeView" for specific "Node". Pin
Judah Gabriel Himango8-Jul-04 9:59
sponsorJudah Gabriel Himango8-Jul-04 9:59 
GeneralRe: "contexMenu" in "TreeView" for specific "Node". Pin
novitzky8-Jul-04 22:01
novitzky8-Jul-04 22:01 
GeneralRe: "contexMenu" in "TreeView" for specific "Node". Pin
saud_a_k9-Jul-04 1:37
saud_a_k9-Jul-04 1:37 
hello,
maybe this can help

private void treeView1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)		
{
	if(e.Button == MouseButtons.Right) 
 	{ 
        	System.EventArgs a = new EventArgs();
		Point ClickPoint = new Point(e.X,e.Y); 
		TreeNode ClickNode = treeView1.GetNodeAt(ClickPoint); 
		ruletree.SelectedNode=ClickNode;
		if(ClickNode == null) return; 
		// Convert from Tree coordinates to Screen coordinates 
		Point ScreenPoint = ruletree.PointToScreen(ClickPoint); 
		// Convert from Screen coordinates to Formc coordinates 
		Point FormPoint = this.PointToClient(ScreenPoint); 
		// Making menu Items---
		ContextMenu treeRCMenu = new ContextMenu();
		//name menu items
                MenuItem mnuRenamePNode = new MenuItem("Rename Node");
		// Show context menu 
           if(clickedNode == node_1.1) 
             {
               treeView1.ContextMenu = contextMenu1; 
             }
     else if (clickedNode == node_1.2) ... and so on   }

	}


be sure to have named you context menu items and initialized them, to use them , you might have to add the event hadler for them.
like:

MenuItem mnuRenamePNode = new MenuItem("Rename Parent Node");
  MenuItem mnuRenameCNode = new MenuItem("Rename Child Node");
//....code
  mnuRenamePNode.Click +=new EventHandler(mnuRenamePNode_Click);
  mnuRenameCNode.Click +=new EventHandler(mnuRenameCNode_Click);
//..etc

GeneralReturning a String from Managed to Unmanaged Code Pin
SanShou8-Jul-04 6:25
SanShou8-Jul-04 6:25 
GeneralRe: Returning a String from Managed to Unmanaged Code Pin
Heath Stewart8-Jul-04 8:49
protectorHeath Stewart8-Jul-04 8:49 
GeneralRe: Returning a String from Managed to Unmanaged Code Pin
SanShou8-Jul-04 8:57
SanShou8-Jul-04 8:57 
Generalmicrosoft.office.interop Pin
dcronje8-Jul-04 5:49
dcronje8-Jul-04 5:49 
GeneralRe: microsoft.office.interop Pin
Heath Stewart8-Jul-04 8:28
protectorHeath Stewart8-Jul-04 8:28 
GeneralIDragSourceHelper problem Pin
TylerBrinks8-Jul-04 4:17
TylerBrinks8-Jul-04 4:17 
GeneralRe: IDragSourceHelper problem Pin
Heath Stewart8-Jul-04 5:28
protectorHeath Stewart8-Jul-04 5:28 
GeneralRe: IDragSourceHelper problem Pin
TylerBrinks8-Jul-04 5:52
TylerBrinks8-Jul-04 5:52 
GeneralRe: IDragSourceHelper problem Pin
Heath Stewart8-Jul-04 6:43
protectorHeath Stewart8-Jul-04 6:43 
GeneralRe: IDragSourceHelper problem Pin
Heath Stewart8-Jul-04 6:53
protectorHeath Stewart8-Jul-04 6:53 
GeneralForm display porblem Pin
wk_vigorous8-Jul-04 1:52
wk_vigorous8-Jul-04 1:52 
GeneralRe: Form display porblem Pin
Nick Parker8-Jul-04 3:43
protectorNick Parker8-Jul-04 3:43 
GeneralRe: Form display porblem Pin
wk_vigorous8-Jul-04 4:43
wk_vigorous8-Jul-04 4:43 
GeneralRe: Form display porblem Pin
Heath Stewart8-Jul-04 5:21
protectorHeath Stewart8-Jul-04 5:21 
GeneralSelection in datagrid gets really slow Pin
Atlemann8-Jul-04 1:02
Atlemann8-Jul-04 1:02 
Generalstring==C#?YES:NO Pin
saud_a_k7-Jul-04 22:49
saud_a_k7-Jul-04 22:49 
GeneralRe: string==C#?YES:NO Pin
SJ_Phoenix8-Jul-04 0:13
SJ_Phoenix8-Jul-04 0:13 

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.