'in a form before enter a number between 2 ~ 20, the name is InputNumber, according to the decision after a form in the textbox control the number of rows, had previously put up 20 row 2 column textbox, 16, if the input is hidden after four lines, namely textbox17 ~ (20 ~ 40. But has written the following code, but can't achieve the function of the hidden, deliver a great god, see how to change!
Public Sub InputCoord () 'based on a dialog box enter the number of groups InputNumber, painting form, hidden extra form Dim As Integer I Dim As Integer k K=20 - InputNumber For I=0 To k If I & lt; K Then The Set m=20 - I Set n=40 -i TextBoxm. Visible=False TextBoxn. Visible=False Labelm. Visible=False End the If Next I
'adjust the entire window length InputNumber3. Height=435-18 * k 'the position adjustment of the "back" button BackButton3. Top=378-18 * k 'adjustment "empty" button location ClearButton3. Top=342-18 * k
'adjustment to empty button positionComButton3. Top=306-18 * k End Sub 'click back button Private Sub BackButton3_Click () InputNumber3. Hide IfYes2. Show End Sub
Click on the delete button, 'ClearYes4 dialog asking whether empty Private Sub ClearButton3_Click () ClearYes4. Show End Sub
'click confirm button Private Sub ComButton3_Click () 'did not fill out the form, have encountered an error For I=1 To InputNumber If (Me. Controls ((" textbox "& amp; I))="" Or Me. Controls (" textbox" & amp; 20 + I))="") Then MsgBox "No empty entries allowed!" End the If Next I 'pop-up warm prompt CommandYes4 dialog box, confirm whether the data is wrong CommandYes4. Show End Sub
CodePudding user response:
For I=0 To k If I & lt; K Then Set m =20 -i Set n=40 -i TextBoxm . Visible=FalseTextBoxn. Visible=False Labelm. Visible=False
The code above is not an error? Regardless of the function whether is in order to implement in a textbox, if he wants to hide, generally using the controls on the form for each cycle, if found horse Match items can be hidden, if it's a cycle by traversing the textbox controls to implement,
CodePudding user response:
God the same code
CodePudding user response:
Alas, even when the bottom of the farmers, also have the basic program of intuition, refueling ah..