-
Jan 11th, 2017, 12:44 PM
#1
Thread Starter
Lively Member
Sorting Text boxes on Form based on Value.
I have a button, what I need it to do is sort all the text boxes based on the Value input. For example.
Based on this, I need the button to sort the Init Value from Highest to lowest. While it does that it will need to move the corresponding Name with it. So it would order "Blink Dog 20, Azer 17, etc." Then I need to reset it all back to default with the reset button.
I am currently getting the value from a dataset + random roll. Here is the code for that. I have 10 different instances of this. So all the 1, is 2 and 3, etc etc.
Boxes are moninit1.text 2, 3, etc (This is for Init that needs to be sorted)... and n1.text 2, 3, etc...(This is for the monster name that needs to move with it.
Code:
Private Sub importmob1_CheckedChanged(sender As Object, e As EventArgs) Handles importmob1.CheckedChanged
'imports selected monster into import table
If importmob1.Checked = True Then n1.Text = Mob1.Text
If importmob1.Checked = False Then n1.Text = ""
Try
'rolls a random 20 sided dice and adds modifiers from amod and dmmod
'TODO - On Error must be replaced with Try, Catch, Finally
Dim initotal As Integer
Dim rannum As Integer
rannum = Int((20 * Rnd()) + 1)
initotal = moninit1.Text
init1.Text = rannum + initotal
If importmob1.Checked = False Then init1.Text = ""
Catch ex As Exception
MsgBox("Make Sure you selected a monster", MsgBoxStyle.Critical, "Error in Application " & Me.Name)
End Try
End Sub
Thanks in Advance!
-Abe
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|