Laeys Posted June 9, 2003 Posted June 9, 2003 Greets to all, This is all I have so far...well for this piece I am working on. Private Sub KeeperClick(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles picDie1.Click, picDie2.Click, picDie3.Click, picDie4.Click, picDie5.Click End Sub heh. there is a whole slew more..but this is what I am looking at: http://members.cox.net/laeys/img/diceKeeper.JPG I want to be able to click the 'This Roll' column anyone of the five pictureboxes inside the groupbox, and have them 'stack' over into the 'Keepers' column. For example, if you were to click the '6' in this image, then click the '2' the '6' would be at the top of the Keepers column with the '2' beneath it. Like this: http://members.cox.net/laeys/img/diceKeeper2.JPG No matter what I have tried, I get a runtime error. Looking for any pointers or assistance. I thank you in advance for your time. Laeys Quote
Administrators PlausiblyDamp Posted June 10, 2003 Administrators Posted June 10, 2003 What is the error you get and on what line of code? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Laeys Posted June 10, 2003 Author Posted June 10, 2003 well actually...I have no more lines of code. I was hoping for a pointer in a new direction on how to approach this. thanks again. Quote
wyrd Posted June 10, 2003 Posted June 10, 2003 A new direction? You could implement drag-and-drop. Although I see nothing wrong with your approach. Add a click event for each die (which you've done), then when clicked check to see if they're inside the This Roll group box. If they are then move 'em to the Keeper group box. You may also want to consider using dynamically created PictureBox objects. Quote Gamer extraordinaire. Programmer wannabe.
Laeys Posted June 10, 2003 Author Posted June 10, 2003 A new direction? You could implement drag-and-drop. I don't know anything about that...in VB, I mean I know what drag and drop is.... Although I see nothing wrong with your approach. Add a click event for each die (which you've done), then when clicked check to see if they're inside the This Roll group box. If they are then move 'em to the Keeper group box. You may also want to consider using dynamically created PictureBox objects. [/b] How would one go about that....pretty new to VB.Net still.... thanks though Quote
aewarnick Posted June 10, 2003 Posted June 10, 2003 Moving the die picture will be manually done by you. When a picturebox is clicked just make that box null and set that picture in the (I guess first) box on the other side and move the others down one. Quote C#
Laeys Posted June 10, 2003 Author Posted June 10, 2003 Moving the die picture will be manually done by you. When a picturebox is clicked just make that box null and set that picture in the (I guess first) box on the other side and move the others down one. Ok....I can reset, set to null, clear the picturebox.clicked Then what? just sorta if picBox1.image = NULL 'not actually sure what this is in VB.Net Then picBox1.image = picBox2.image picBox2.image = picBox3.image ... ... ... that work out? I am away from my workstation. Then also I have no idea how to get them to dynamically place into the 'Keeper' column. Thanks again for the help. Laeys Quote
aewarnick Posted June 10, 2003 Posted June 10, 2003 It will be a simple thing to do if you know your syntax... I would give you a code example but you probably won't understand it. I use C# not VB. Quote C#
Laeys Posted June 10, 2003 Author Posted June 10, 2003 well I know a little C++ also, more C than C++ so if you want to...I can try to translate it. thanks either way :) Quote
aewarnick Posted June 10, 2003 Posted June 10, 2003 This should do it. Still needs some work though, but it sould get you started. That is, if you can translate it. //Create references to your pictureboxes: PictureBox[] keepers={this.picturebox1, this.picturebox2, this.picturebox3, this.picturebox4}; //Create a function to move the die in Keepers down one. void MoveDown() { int i = keepers.Length-1; while(i > 1) { try { keepers[i].Image = keepers[i-1].Image; } catch(Exception ex) {MessageBox.Show(ex+"");} i = i-1; } } Quote C#
Laeys Posted June 11, 2003 Author Posted June 11, 2003 I appreciate the help there aewarnick, really I do. You were right though, for my purposes I was unable to translate. Anyways, thanks again and I wish you luck. No one has tried this before? I admit I am new, and not the greatest logical programmer...it just seems odd no one has done something like this before. Quote
aewarnick Posted June 11, 2003 Posted June 11, 2003 Well, since you are familiar with C, learning C# will be easier than VB .net. And C# and VB.net are just about the same. This is an array symbol [] I think you need to learn either VB .net syntax before trying to make a program like that. Or C# as I said. Good luck in whatever you choose. Quote C#
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.