我想让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
------解决方案--------------------
用普通的按钮可以。