winform代码生成下拉框的倒小三角

//TextBox
this.m_TextBox = new TextBox();
this.m_TextBox.KeyDown += new KeyEventHandler(m_TextBox_KeyDown);
this.m_TextBox.Parent = this;

            //Button
            this.m_DropdownButton = new Button();
            //Assembly asm = Assembly.GetExecutingAssembly();
            //System.IO.Stream stream = asm.GetManifestResourceStream(asm.GetName().Name + ".BM_dropdown.bmp");
            Bitmap bm = new Bitmap(this.GetType(), "1.bmp");
            this.m_DropdownButton.Image = bm;
            this.m_DropdownButton.Width = 16;
            this.m_DropdownButton.Height = this.m_TextBox.Height - 2;
            this.m_DropdownButton.Location = new Point(this.m_TextBox.Right - 18, 1);
            this.m_DropdownButton.Click += new EventHandler(m_DropdownButton_Click);
            //this.m_DropdownButton.FlatStyle = FlatStyle.Flat;
            this.m_DropdownButton.Parent = this;
            this.m_DropdownButton.BringToFront();

            //image
            this.m_Pic = new PictureBox();
            this.m_Pic.Image = Image.FromFile("E:\\NewLayerTool\\TreeComboBox\\1.bmp", false);
            this.m_Pic.Width = 16;
            this.m_Pic.Height = this.m_TextBox.Height - 2;
            this.m_Pic.Location = new Point(this.m_TextBox.Right - 18, 1);
            this.m_Pic.Click += new EventHandler(m_Pic_Click);
            this.m_Pic.BackColor = Color.White;
            this.m_Pic.Parent = this;
            this.m_Pic.BringToFront();


//TreeView
this.m_TreeView = new TreeView();
this.m_TreeView.Visible = false;
this.m_TreeView.DoubleClick += new EventHandler(m_TreeView_DoubleClick);
this.m_TreeView.KeyDown += new KeyEventHandler(m_TreeView_KeyDown);
this.m_TreeView.LostFocus += new EventHandler(m_TreeView_LostFocus);
this.m_TreeView.BeforeExpand += new TreeViewCancelEventHandler(m_TreeView_BeforeExpand);
this.m_TreeView.BeforeCollapse += new TreeViewCancelEventHandler(TreeComboBox_BeforeCollapse);
this.m_TreeView.AfterExpand += new TreeViewEventHandler(m_TreeView_AfterExpand);
this.m_TreeView.AfterCollapse += new TreeViewEventHandler(TreeComboBox_AfterCollapse);
this.m_TreeView.Location = new Point(0, 0);
this.m_TreeView.Parent = null;


this.LostFocus += new EventHandler(TreeComboBox_LostFocus);


比较倒三角是按钮或者图片,哪种更接近combobox

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值