问题描述
我有一个组合框,文本框,numericUpDown和masktextbox.我希望填充所有这些内容,以便使用
I have a combobox, textbox, numericUpDown and a masktextbox. I want all these to be filled so that a
推荐答案
If cboselect.SelectedIndex = -1 Or nuddigits.Value = 0 Or String.IsNullOrEmpty(textbox1.Text) Or Not mxttime.Enabled Or Not mxTtime.MaskCompleted Then
不一样.好的,我会解释清楚.
我有一个组合框,其中有3个项,分别是红色,蓝色,黑色和绿色.选择红色"或蓝色"时,将禁用masked文本框,否则将为其他颜色启用它.
当我选择红色或蓝色的MaskedTextBox中被禁用,不错,但问题是我选择了这些颜色时,仍然can''t保存因为即使残疾人,我得到的消息框,提示我去填满它.
所以?这只是在if
条件下使逻辑正确的一种情况:
"No its the same. Ok, I will explain well.
I have a combobox which has 3 items namely Red, Blue, Black and Green. When Red or Blue is selected, the maskedtextbox is disabled else it is enabled for the other colours if selected.
when I select Red or Blue, the maskedtextbox is disabled, good, but the problem is I still can''t save as even disabled when selected these colours, i get the message box to prompt me to fill it."
So? That''s just a case of getting the logic right in your if
condition:
If cboselect.SelectedIndex = -1
Or nuddigits.Value = 0
Or String.IsNullOrEmpty(textbox1.Text)
Or (mxttime.Enabled And Not mxTtime.MaskCompleted)
Then
(我把行打断了,所以您可以更轻松地看到它们)
(I broke the lines up so you can see them a bit more easily)
这篇关于遮罩文字框问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!