当前位置: 代码迷 >> .NET组件控件 >> DevExpress 按钮设置背景图片的时出现了一点有关问题
  详细解决方案

DevExpress 按钮设置背景图片的时出现了一点有关问题

热度:155   发布时间:2016-05-04 23:23:46.0
DevExpress 按钮设置背景图片的时出现了一点问题

我想让simplebutton上显示这张图片,上面是我实现的,但是当鼠标移动到这张图片时,按钮样式又会变成下面这样,也就是说图片没了


this.simpleButton1.Appearance.BackColor = System.Drawing.Color.Transparent;
this.simpleButton1.Appearance.Options.UseBackColor = true;
this.simpleButton1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("simpleButton1.BackgroundImage")));
this.simpleButton1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.simpleButton1.ButtonStyle = DevExpress.XtraEditors.Controls.BorderStyles.UltraFlat;
this.simpleButton1.Location = new System.Drawing.Point(45, 6);
this.simpleButton1.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.UltraFlat;
this.simpleButton1.LookAndFeel.UseDefaultLookAndFeel = false;
this.simpleButton1.Name = "simpleButton1";
this.simpleButton1.Size = new System.Drawing.Size(218, 120);
this.simpleButton1.TabIndex = 0;
this.simpleButton1.Text = "生产相关";

我记得WinForm的Button是有个可以设置获得焦点后的按钮样式的,但是在SimpleButton里都没找到
------解决方案--------------------
用按钮的mouseenter和mouseleave事件来控制呢?
------解决方案--------------------
好像还不支持BackgroundImage;
https://community.devexpress.com/forums/t/5791.aspx
------解决方案--------------------
引用:
好像还不支持BackgroundImage;
https://community.devexpress.com/forums/t/5791.aspx

用普通的按钮可以。
  相关解决方案