添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
btnSubmit_CrtIss.Enabled = False btnReset_CrtIss.Enabled = False
but it looks awful, just like a greyed out text box, my goal is to prevent users from clicking those buttons.
Please help You could just eat the event if the button is locked. However, making the button disabled is the standard indisutry way of saying "you can't use this control right now".
If you don't like the grayed-out appearance, you could always completely hide them, but I can tell you from a number of years of experience designing user interfaces that users don't really like it when stuff just disappears from the screen. I've had customers complain that when textboxes are disabled or even just readonly they can't read the value in them. To get around things like that I have a variable that tracks when things are supposed to be read-only. Then every event for those controls just gets skipped when that variable is set to true. So, something like this:
Dim boolMakeReadOnly as Boolean = True Private Sub btnSubmit_Click(ByVal sender As System. Object , ByVal e As System.EventArgs) Handles btnSubmit.Click If boolMakeReadOnly Then Return ' This exits the event ' Original code for the submit button (gets skipped if boolMakeReadOnly is true ) End Sub
  • Read the question carefully.
  • Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  • If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  • Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question. Let's work to help developers, not make them feel stupid.
  •