当我禁用它时,我想保持按钮颜色不会变为灰色。我使用图像作为背景颜色,并将其设置ForeColor
为白色。当按钮被禁用时,我想保持原样,而不是将其更改为灰色。我的代码是:
Private Sub btnItemNonTaxable_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnItemNonTaxable.Click
If Shift = 0 Then
MessageBox2("Please Begin the Shift before you start the transaction.", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
Exit Sub
End If
txtNonInventoryQuantity.Text = "1"
pnlOpenItem.Visible = True
LabelNonInventory.Text = "Non-Inventory Non-Taxable"
isOpenItem = True
chkTax1.Visible = False
chkTax1.Checked = False
txtPrice.Focus()
btnCashDrop.Enabled = False
If Not btnCashDrop.Enabled Then
btnCashDrop.Image = My.Resources.small_green
btnCash.ForeColor = Color.White
End If