Отключение поведения наведения на кнопках WinformC#

Место общения программистов C#
Ответить
Anonymous
 Отключение поведения наведения на кнопках Winform

Сообщение Anonymous »

Я разрабатываю приложение winform с использованием C# 4.0

У меня есть форма с одной кнопкой. Я изменил цвет кнопки BackColor на желтый. Во время выполнения цвет задней части кнопки слегка меняется, когда я навожу на нее указатель мыши. Я хочу отключить это. Я хочу, чтобы цвет оставался неизменным, что бы ни случилось.

Вот код формы:

Код: Выделить всё

using System;
using System.Windows.Forms;

namespace Something
{
public partial class Home : Form
{
public Home()
{
InitializeComponent();
}

}
}

namespace Something
{
partial class Home
{
/// 
/// Required designer variable.
/// 
private System.ComponentModel.IContainer components = null;

/// 
/// Clean up any resources being used.
/// 
/// 
true if managed resources should be disposed; otherwise, false.
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}

#region Windows Form Designer generated code

/// 
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// 
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Home));
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button1
//
this.button1.BackColor = System.Drawing.Color.Yellow;
resources.ApplyResources(this.button1, "button1");
this.button1.Name = "button1";
this.button1.UseVisualStyleBackColor = false;
//
// Home
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(226)))), ((int)(((byte)(227)))), ((int)(((byte)(228)))));
this.Controls.Add(this.button1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "Home";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.Load += new System.EventHandler(this.Home_Load);
this.ResumeLayout(false);

}

#endregion

private System.Windows.Forms.Button button1;

}
}
Заранее спасибо.


Подробнее здесь: https://stackoverflow.com/questions/196 ... rm-buttons
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «C#»