我正在创建一个具有默认属性的按钮,除了FlatStyle = 0, BorderSize = 0, MouseDownBackColor = Transparent, MouseOverBackColor = Transparent, BackgroundImageLayout = Stretch
使用我MouseEnter
使用以下语法创建的事件
private void SearchBorrowerbutton_MouseEnter(object sender, EventArgs e)
{
SearchBorrowerbutton.Image = Properties.Resources.ButtonsShinnig;
}
MouseLeave
语法为
private void SearchBorrowerbutton_MouseLeave(object sender, EventArgs e)
{
SearchBorrowerbutton.Image = Properties.Resources.Buttons;
}
现在我的问题是,每当我的鼠标指向SearchBorrowerbutton
图像更改但它不在时,Stretch property
我已经尝试过这个
private void SearchBorrowerbutton_MouseEnter(object sender, EventArgs e)
{
SearchBorrowerbutton.BackgroundImageLayout = ImageLayout.Stretch;
SearchBorrowerbutton.Image = Properties.Resources.ButtonsShinnig;
}
private void SearchBorrowerbutton_MouseLeave(object sender, EventArgs e)
{
SearchBorrowerbutton.BackgroundImageLayout = ImageLayout.Stretch;
SearchBorrowerbutton.Image = Properties.Resources.Buttons;
}
但它仍然显示在 Tile 属性上