Well i'll try to be clear as possible, i'm making like an account organizer (helper/tool) w.e you wanna call it, and for example i have 10 accounts.
I want to delete account #5 (They are array), what i need it to do is move account #6, 7, 8, 9 & 10 down and number 5 would be the last account (Last account will be blank).
I have this Listbox to change in between the accounts, so i can change from 1 to 10 fast, account 11 is just blank just if i want to add another account.
My codes:
Accounts
Option Explicit On
Public Class Accounts
Private mVersion As String
Private mUsername As String
Private mPassword As String
Private mCharacter As String
Private mServer As String
Private mLogin As String
Private mReturnLogin As Boolean
Private mLoginStart As Boolean
Private mRelogDisco As Boolean
Private mDisMap As Boolean
Private mSpecialAcc As Boolean
Public Sub New(ByVal Version As String, ByVal Login As String, ByVal Username As String, ByVal Password As String, ByVal Character As String, ByVal Server As String, ByVal ReturnLogin As Boolean, ByVal LoginStart As Boolean, ByVal RelogDisco As Boolean, ByVal DisMap As Boolean, ByVal SecialAcc As Boolean)
mVersion = Version
mUsername = Username
mPassword = Password
mCharacter = Character
mServer = Server
mLogin = Login
mReturnLogin = ReturnLogin
mLoginStart = LoginStart
mRelogDisco = RelogDisco
mDisMap = DisMap
mSpecialAcc = SpecialAcc
End Sub
Property Version() As String
Get
Return mVersion
End Get
Set(ByVal value As String)
mVersion = value
End Set
End Property
Property Username() As String
Get
Return mUsername
End Get
Set(ByVal value As String)
mUsername = value
End Set
End Property
Property Password() As String
Get
Return mPassword
End Get
Set(ByVal value As String)
mPassword = value
End Set
End Property
Property Character() As String
Get
Return mCharacter
End Get
Set(ByVal value As String)
mCharacter = value
End Set
End Property
Property Server() As String
Get
Return mServer
End Get
Set(ByVal value As String)
mServer = value
End Set
End Property
Property Login() As String
Get
Return mLogin
End Get
Set(ByVal value As String)
mLogin = value
End Set
End Property
Property ReturnLogin() As Boolean
Get
Return mReturnLogin
End Get
Set(ByVal value As Boolean)
mReturnLogin = value
End Set
End Property
Property LoginStart() As Boolean
Get
Return mLoginStart
End Get
Set(ByVal value As Boolean)
mLoginStart = value
End Set
End Property
Property RelogDisco() As Boolean
Get
Return mRelogDisco
End Get
Set(ByVal value As Boolean)
mRelogDisco = value
End Set
End Property
Property DisMap() As Boolean
Get
Return mDisMap
End Get
Set(ByVal value As Boolean)
mDisMap = value
End Set
End Property
Property SpecialAcc() As Boolean
Get
Return mSpecialAcc
End Get
Set(ByVal value As Boolean)
mSpecialAcc = value
End Set
End Property
End Class
New Account:
Dim CurrentAcc(-1) As Accounts
Private Sub NewAcc(ByVal wIndex As Integer)
ReDim Preserve CurrentAcc(CurrentAcc.GetUpperBound(0) + 1)
If Me.AccNumber.Text = "" Then
Me.CurrentAcc(0) = New Accounts("Silkroad International", "Random", "", "", "", "", False, False, False, False, False)
Me.AccNumber.Items.Add("1")
Me.AccNumber.SelectedIndex = (0)
Else
Me.CurrentAcc(Me.AccNumber.Text + wIndex) = New Accounts("Silkroad International", "Random", "", "", "", "", False, False, False, False, False)
End If
End Sub
Add/Edit Account:
Private Sub AddEdit_Btn_Click(sender As System.Object, e As System.EventArgs) Handles AddEdit_Btn.Click
If Not Me.IDTextbox.Text = String.Empty And Not Me.PWTextbox.Text = String.Empty And Not Me.CharTextbox.Text = String.Empty Then
CurrentAcc(Me.AccNumber.SelectedIndex).Version = Me.SVersion.Text
CurrentAcc(Me.AccNumber.SelectedIndex).Username = Me.IDTextbox.Text
CurrentAcc(Me.AccNumber.SelectedIndex).Password = Me.PWTextbox.Text
CurrentAcc(Me.AccNumber.SelectedIndex).Character = Me.CharTextbox.Text
CurrentAcc(Me.AccNumber.SelectedIndex).Server = Me.SName.Text
CurrentAcc(Me.AccNumber.SelectedIndex).ReturnLogin = Me.LReturn.Checked
CurrentAcc(Me.AccNumber.SelectedIndex).LoginStart = Me.LStart.Checked
CurrentAcc(Me.AccNumber.SelectedIndex).ReturnLogin = Me.LReturn.Checked
CurrentAcc(Me.AccNumber.SelectedIndex).RelogDisco = Me.RDisconnect.Checked
CurrentAcc(Me.AccNumber.SelectedIndex).SpecialAcc = Me.SAccount.Checked
If Me.AccNumber.Items.Count <= Me.AccNumber.Text Then
NewAcc(0)
Me.AccNumber.Items.Add(Me.AccNumber.Text + 1)
Me.AccNumber.SelectedItem = (Me.AccNumber.Text + 1)
DefaultProf()
Else
Me.AccNumber.SelectedItem = (Me.AccNumber.Text + 1)
End If
Else
MessageBox.Show("Please don't leave any box in blank", "phBot Account Manager", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
End If
End Sub
I need help on the part of moving down the arrays.
I deleted account #5 so i want account#5 to be the last accounts and all accounts after 5 to move 1 place down.
Any help ? Thx.