tepe15 Posted August 22, 2014 Author Share Posted August 22, 2014 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 More sharing options...
Officer Johnson Posted August 22, 2014 Share Posted August 22, 2014 First off that code makes no sense to me? care to explain and if that is the only thing you have added it will of course not work. more info pleasePersonally i'd make a new form that gets called on button click and they can select there sprite/class or whatever from there. Link to comment Share on other sites More sharing options...
rairai5650 Posted August 23, 2014 Share Posted August 23, 2014 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``` Link to comment Share on other sites More sharing options...
hisherwin Posted August 23, 2014 Share Posted August 23, 2014 > 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 More sharing options...
tepe15 Posted August 23, 2014 Author Share Posted August 23, 2014 I want use button to change classI solved this problem.```Private Sub Command1_Click()cmbClass.ListIndex = cmbClass.ListIndex + 1End Sub```For cmbClass: Visible - NoThis button works. but i got error when I want skip the last class.Run-time error 380Invalid property valueOkey so, i can use this code: ( I have 6 classes )```Private Sub Command1_Click()cmbClass.ListIndex = cmbClass.ListIndex + 1If cmbClass.ListIndex > 5 ThencmbClass.ListIndex = 0End IfEnd Sub```but i still have errorRun-time error 380Invalid property valuecmbClass.ListIndex = must be 0 because if I give 1 I don't see my first classIf i Give this code:```Private Sub Command1_Click()cmbClass.ListIndex = cmbClass.ListIndex + 1If cmbClass.ListIndex > 4 ThencmbClass.ListIndex = 0End IfEnd Sub```I dont' see last class ….Do You have some ideas?one solution what I came up with is to add one empty classbut 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 More sharing options...
hisherwin Posted August 23, 2014 Share Posted August 23, 2014 EDIT: DELETED!!! THE WEBSITE DOESN'T ACCEPT MY POST!!I'll PM You on what to do Link to comment Share on other sites More sharing options...
hisherwin Posted August 23, 2014 Share Posted August 23, 2014 There's something wrong with this website -.-Let me update my last post for you.. just wait for a moment Link to comment Share on other sites More sharing options...
Stach Posted August 23, 2014 Share Posted August 23, 2014 ```Private Sub Command1_Click() If cmbClass.ListIndex < 5 Then cmbClass.ListIndex = cmbClass.ListIndex + 1 Else cmbClass.ListIndex = 0 End IfEnd Sub``` Link to comment Share on other sites More sharing options...
tepe15 Posted August 24, 2014 Author Share Posted August 24, 2014 Solved! Thank you so much Tael :) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now