1. Treeview Node Loses highlight when context menu opens
Here's what I'm doing to make the right context mnue show up based on
what node was cliked:
private void tvwMenu_MouseUp(object sender, MouseEventArgs e)
{
//Select Node When Right Clicked & Set Context Menu To Use
if( e.Button == MouseButtons.Right )
{
TreeNode node = tvwMenu.GetNodeAt( new Point( e.X, e.Y ) );
if( node != null )
{
TreeNodeMenuTag tag = (TreeNodeMenuTag)node.Tag;
tvwMenu.SelectedNode = node;
tvwMenu.ContextMenuStrip = (tag.isMenu) ? cmnuMenuNode :
cmnuProgramNode;
}
}
}
It works, but unlike the Solution Explorer treeview in VS when you
right click on a node the node loses its highlight. I don't like this
cux it makes it less obvious which node you are operating on. Anyone
know how to fix this?
Thanks.
2. Context Menu - Microsofts standard file context menu - CSharp/C#
3. Highlight text and right click for a custom context menu, asp
Dear All I have a project on making a UI of a Web page that allows users to: 1. select any text by highlighting it, and 2. do some action on it by right-clicking on the highlighted text and choose an action among those options presented by the context menu items that appears. 3. send the chosen action along with the text and its attributes to the server as the user clicks on the desired menu item. Interestingly, the next stage is to make the menu items customised by the type of the selected text, e.g. a link or an ordinary body text. Does anyone know if all these can be done fully using ASP.Net at the server side? Could anyone help, please? Many thanks in advance.
4. Highlighting item cursor is over when displaying context menu - .NET Windows Forms
5. Inserting Win Media Player as Context Menu strip in Context Menu
Hi All, (regarding Context Menu strip)
I am trying to insert a custom control / .Net control in
Context menu as a
context menu strip. I tried inserting MonthCalender in Context Menu as
a context menu strip, it worked.
Now, i tried same with Windows Media Player ( a control available in
C#.Net). But I'm not able to set its URL property (i.e. path of the
media file). and i'm getting the exception like
System.Windows.Forms.AxHost+InvalidActiveXStateException.
Those who are interested may read below extended information:
I have created one class named as Class2 i.e. Class2.cs file : Code
are as below
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using AxWMPLib;
using System.ComponentModel.Design.Serialization;
namespace ToolStripBaseRenderer
{
class Class2 : ToolStripControlHost
{
public Class2() : base(new AxWMPLib.AxWindowsMediaPlayer())
{ }
public AxWindowsMediaPlayer AxWPlayer
{
get
{
return Control as AxWindowsMediaPlayer;
}
}
public System.Drawing.Size WPlayerSize
{
get { return AxWPlayer.Size; }
set
{
AxWPlayer.Size = value;
}
}
public AxHost.State WPlayerAXHost
{
set
{
AxWPlayer.OcxState = value;
}
get
{
return AxWPlayer.OcxState;
}
}
public string WPlayerURL
{
get
{
return AxWPlayer.URL;
}
set
{
AxWPlayer.URL = value;
}
}
}
}
One windows form i.e. Form1.cs
Load event of Form1 is as below:
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private void Form1_Load(object sender, EventArgs e)
{
Class2 cls2 = new Class2();
cls2.WPlayerSize = new System.Drawing.Size(237, 180);
string fpath = "C:\\a.wmv";
cls2.WPlayerURL = fpath;
contextMenuStrip1.Items.Add(cls2);
}
Now in above code i'm getting an exception while assigning 'fpath'
value to URL of windows media player
i.e. at statement cls2.WPlayerURL = fpath;
Exception is like "System.Windows.Forms.AxHost
+InvalidActiveXStateException".
If i set OcxState property (i.e here it is WPlayerAXHost in Class2.cs
file) of windows media player from Form1_Load event than it may solve
problem ....but the issue is i' dont know exactly WHY i need to set
that property and how to set that property....
If ne body have ne solution plz help me out.....if above data is not
enough to understand i can send the whole project....
6. Context menus and treeviews, suggestions for a NODE sensitive context menu - .NET Windows Forms
7. Setting the highlight bar color on a menu
How can I change the highlight bar color on a main menu? If I have to use owner draw, can you show me a snippet of code that does this? Thanks for any help. Bernie Yaeger