n00b picturebox question

Laeys

Member
Joined
Jun 9, 2003
Messages
6
Location
online
Greets to all,

This is all I have so far...well for this piece I am working on.

Code:
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:
[Broken External Image]: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:

[Broken External Image]: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
 
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.
 
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 youve done), then when clicked check to see if theyre 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.
 
Originally posted by wyrd
A new direction? You could implement drag-and-drop.
I dont 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 youve done), then when clicked check to see if theyre 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
 
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.
 
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
Code:
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
 
It will be a simple thing to do if you know your syntax...

I would give you a code example but you probably wont understand it. I use C# not VB.
 
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 :)
 
This should do it. Still needs some work though, but it sould get you started. That is, if you can translate it.
C#:
//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;
	}
}
 
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.
 
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.
 
Back
Top