Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted

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.

Posted
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.
Gamer extraordinaire. Programmer wannabe.
Posted
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

Posted
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.
C#
Posted
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

Posted

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;
}
}

C#
Posted

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.

Posted

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.

C#

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...