question

TZacks-2728 avatar image
0 Votes"
TZacks-2728 asked karenpayneoregon answered

C# Winform and button menu

i have follow instruction from where to get the job done https://stackoverflow.com/a/10803307/9359783

but see this one https://stackoverflow.com/a/27173509/9359783
guide me how to implement it ?

i want design should be same as image given there. i am talking about this image https://i.stack.imgur.com/gY8Xf.png
the image has nice divider....how to have it ? image has arrow....does it created by code ?

thanks

dotnet-csharpwindows-forms
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

karenpayneoregon avatar image
1 Vote"
karenpayneoregon answered TZacks-2728 commented

See the following custom control.

My test

118670-figure2.png

 using System;
 using System.Windows.Forms;
    
 namespace SplitButtonDemo
 {
     public partial class Form1 : Form
     {
         public Form1()
         {
             InitializeComponent();
         }
    
         private void firstToolStripMenuItem_Click(object sender, EventArgs e)
         {
             MessageBox.Show($@"Hello from {((ToolStripMenuItem)sender).Name}");
         }
    
         private void OptionsButton_Click(object sender, EventArgs e)
         {
             MessageBox.Show("Clicked");
         }
     }
 }




figure2.png (2.2 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.