Thanks for the reply this is the main question.
i was told to make 5 textboxes in a array form and 2 command buttons,and the command buttons will be named sort ascending and sort descending,so i will write a code to use the command buttons to the sort the textboxes in ascending and descending order.
I don't see what's so hard to understand.
There are 5 text boxes, each with some text.
There is a command button labeled ascending.
Click this button and the
-- first checkbox contains the smallest ordinal value of the 5.
-- second checkbox contains the next smallest ordinal value.
ruudycruise, based on your second post, my suggestion didn't help?
This is the full question: Mark textboxes in an array & make also two command buttons(not in an array) name the command buttons as (1) sort ascending (2) sort descending.
Code the above command buttons such thta by clicking on sort ascending then the text of numbers entered in the textboxes should get in ascending order and when you click on the the descending order to do same also.
Use the following as a sample and just reverse it to do the descending -
Private Sub Command1_Click()
Dim x As Integer, y As Integer
If Text1(0).Text = 1 Then
Text1(0).Text = 5
y = Text1(0).Text + 1
For x = 0 To Text1(Index) - 1
Text1(x).Text = y - 1
y = y - 1
I tried your code sir... but unfortunately it didn't work..
I'm using VB 6.0 .. I'm New in VB so I'm still searching and studying it..
every time I click the command button it always says this " Wrong Number of argument or invalid property assignment"
I'm working on it now.. but I still fail to run it successfully..
Thank you sir!
For Each ctrl As Control In Me.Controls("pnlMainPanel").Controls
If ctrl.GetType Is GetType(System.Windows.Forms.Panel) Then
For Each subCtrl As Control In ctrl.Controls
If subCtrl.GetType Is GetType(System.Windows.Forms.TextBox) Then
If subCtrl.GetType Is ...