Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

One button to select Class


tepe15
 Share

Recommended Posts

Hello guys!

I use eclipse Worlds and I have a little problem.

I want add new button to select class but i don't know how code I must use for this.

Combo box is not elegant.

I have something like this:

```

' next class
NewCharClass = NewCharClass + 1
If NewCharClass > 3 Then
NewCharClass = 1
End If

```
But this code doesn't work in Eclipse Worlds.

Can you help me?
Link to comment
Share on other sites

> Not  sure about this why don't you change 
>
> ```
> ' next class
> NewCharClass = NewCharClass + 1
> If NewCharClass > 3 Then
> NewCharClass = 1
> End If
>
> ```
> to
>
> ```
> ' next class
> NewCharClass = NewCharClass = 1
> If NewCharClass > 3 Then
> NewCharClass = 1
> End If
>
> ```

Da Hell is this?

On-Topic: Please give me more information about what you are talking about O.o, Are you planning to use a combobox or do you planned to render a button on changing the class?
Link to comment
Share on other sites

I want use button to change class

I solved this problem.

```

Private Sub Command1_Click()
cmbClass.ListIndex = cmbClass.ListIndex + 1
End Sub

```
For cmbClass: Visible - No

This button works. but i got error when I want skip the last class.

Run-time error 380

Invalid property value

Okey so, i can use this code: ( I have 6 classes )

```

Private Sub Command1_Click()
cmbClass.ListIndex = cmbClass.ListIndex + 1
If cmbClass.ListIndex > 5 Then
cmbClass.ListIndex = 0
End If
End Sub

```
but i still have error

Run-time error 380

Invalid property value

cmbClass.ListIndex = must be 0 because if I give 1 I don't see my first class

If i Give this code:

```

Private Sub Command1_Click()
cmbClass.ListIndex = cmbClass.ListIndex + 1
If cmbClass.ListIndex > 4 Then
cmbClass.ListIndex = 0
End If
End Sub

```
I dont' see last class ….

Do You have some ideas?

one solution what I came up with is to add one empty class

but it doesn't solution for the problem and this class is visible in combobox if combobox is of course visible
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...