Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
i am create a webbrowser with the html button an label on click on button or label these object or shown in the webbrowser control but i iwant to know that how can i show the context menu on the button or label conming from the html

C#
public void button()
        {
            frmButtonProperties p = new frmButtonProperties(); 
            if (p.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                string button = "<input id=\"Button2\" type=\"button\" value=\"" + p.SelectedCaption + "\" style=\"background-color: " + p.SelectedBackColor +
                    "; height: " + p.SelectedHeight + "; width: " + p.SelectedWidth + "; color: " + p.SelectedForeColor + "\" />";

                Button btn = new Button();
                btn.ContextMenuStrip = ButtonContextMenu;
                webBrowser1.Controls.Add(btn);
                sb.Append(button);
                webBrowser1.DocumentText = sb.ToString();

            } 

        }

Know how can I give context menu control to the string button which shows the html button in webbrowser control

[edit]Code block added, SHOUTING removed - OriginalGriff[/edit]
Posted
Updated 10-Jun-12 21:00pm
v2
Comments
OriginalGriff 11-Jun-12 3:00am    
DON'T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalisation if you want to be taken seriously.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900