Click here to Skip to main content
16,005,281 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Unrecognized database format Pin
Dave Kreskowiak2-May-09 4:17
mveDave Kreskowiak2-May-09 4:17 
GeneralRe: Unrecognized database format Pin
ivo752-May-09 5:15
ivo752-May-09 5:15 
GeneralRe: Unrecognized database format Pin
Dave Kreskowiak2-May-09 16:23
mveDave Kreskowiak2-May-09 16:23 
GeneralRe: Unrecognized database format Pin
ivo751-May-09 10:20
ivo751-May-09 10:20 
GeneralRe: Unrecognized database format Pin
ivo751-May-09 10:25
ivo751-May-09 10:25 
AnswerRe: Unrecognized database format Pin
Mycroft Holmes30-Apr-09 17:42
professionalMycroft Holmes30-Apr-09 17:42 
GeneralRe: Unrecognized database format Pin
ivo7530-Apr-09 20:25
ivo7530-Apr-09 20:25 
QuestionNewbie trying to do Drag and Drop of Images Pin
ymilan30-Apr-09 6:21
ymilan30-Apr-09 6:21 
Hello,

I'm trying to drag and drop an image (picture) from a column on the left to a column of blank pictures on the right, so I can drop over the blank picture with the original picture. Card game actually.

Image1(52) are the pictures of cards on the left
Hearts(12) are the hearts suit on the right
Clubs(12) also; I haven't finished setting up Spades or Diamonds yet.

Here is the code. I cannot get it to work; the images on the left won't move. Just receive a black circle with a diagnal line through it. Any ideas on how I can solve this would be excellent. Much appreciation in advance.

Private Sub Image1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Image1.MouseDown
Dim Index As Integer
Index = 0
For Index = 0 To 51
DoDragDrop(Image1(Index), DragDropEffects.Copy)
Next
End Sub
Private Sub Image1_DragEnter(ByVal sender As Object, ByVal e As DragEventArgs) Handles Image1.DragEnter, Hearts.DragEnter, Clubs.DragEnter 'Diamonds.DragEnter, Spades.DragEnter
Dim Index As Integer
Index = 0
For Index = 0 To 51
DoDragDrop(Image1(Index), DragDropEffects.Move)
Next
End Sub

Private Sub Image1_DragDrop(ByVal sender As Object, ByVal e As DragEventArgs) Handles Image1.DragDrop, Hearts.DragDrop, Clubs.DragEnter ' Diamonds.DragEnter, Spades.DragEnter
Dim Button As Short

If Button = VB6.MouseButtonConstants.LeftButton Then
Hearts(12).Image = Image1(0).Image
Hearts(11).Image = Image1(1).Image
Hearts(10).Image = Image1(2).Image
Hearts(9).Image = Image1(3).Image
Hearts(8).Image = Image1(4).Image
Hearts(7).Image = Image1(5).Image
Hearts(6).Image = Image1(6).Image
Hearts(5).Image = Image1(7).Image
Hearts(4).Image = Image1(8).Image
Hearts(3).Image = Image1(9).Image
Hearts(2).Image = Image1(10).Image
Hearts(1).Image = Image1(11).Image
Hearts(0).Image = Image1(12).Image

Clubs(12).Image = Image1(25).Image
Clubs(11).Image = Image1(24).Image
Clubs(10).Image = Image1(23).Image
Clubs(9).Image = Image1(22).Image
Clubs(8).Image = Image1(21).Image
Clubs(7).Image = Image1(20).Image
Clubs(6).Image = Image1(19).Image
Clubs(5).Image = Image1(18).Image
Clubs(4).Image = Image1(17).Image
Clubs(3).Image = Image1(16).Image
Clubs(2).Image = Image1(15).Image
Clubs(1).Image = Image1(14).Image
Clubs(0).Image = Image1(13).Image

e.Effect = DragDropEffects.Link

If e.Effect <> DragDropEffects.Link Then
e.Effect = DragDropEffects.None
MsgBox("This card does not belong here.")
End If
End If

End SubConfused | :confused:
AnswerRe: Newbie trying to do Drag and Drop of Images Pin
Henry Minute30-Apr-09 8:01
Henry Minute30-Apr-09 8:01 
GeneralRe: Newbie trying to do Drag and Drop of Images Pin
ymilan1-May-09 4:23
ymilan1-May-09 4:23 
GeneralRe: Newbie trying to do Drag and Drop of Images Pin
ymilan1-May-09 4:23
ymilan1-May-09 4:23 
GeneralRe: Newbie trying to do Drag and Drop of Images Pin
Henry Minute1-May-09 8:36
Henry Minute1-May-09 8:36 
Questionwhat's wrong in this code? Pin
rajulama30-Apr-09 3:36
rajulama30-Apr-09 3:36 
AnswerRe: what's wrong in this code? Pin
Jay Royall30-Apr-09 4:18
Jay Royall30-Apr-09 4:18 
AnswerRe: what's wrong in this code? Pin
Dave Kreskowiak30-Apr-09 13:52
mveDave Kreskowiak30-Apr-09 13:52 
GeneralRe: what's wrong in this code? Pin
Jeff Circeo1-May-09 3:17
Jeff Circeo1-May-09 3:17 
QuestionHow to Set Culture Info to a Datagridview Column? Pin
Paramu197330-Apr-09 3:01
Paramu197330-Apr-09 3:01 
AnswerRe: How to Set Culture Info to a Datagridview Column? Pin
Henry Minute30-Apr-09 8:44
Henry Minute30-Apr-09 8:44 
Questioncontent Pin
girikaimal30-Apr-09 2:43
girikaimal30-Apr-09 2:43 
AnswerRe: content Pin
dan!sh 30-Apr-09 2:46
professional dan!sh 30-Apr-09 2:46 
AnswerRe: content Pin
Christian Graus30-Apr-09 10:39
protectorChristian Graus30-Apr-09 10:39 
QuestionCalculating with Time Pin
Zaegra30-Apr-09 2:09
Zaegra30-Apr-09 2:09 
AnswerRe: Calculating with Time Pin
Luc Pattyn30-Apr-09 2:12
sitebuilderLuc Pattyn30-Apr-09 2:12 
AnswerRe: Calculating with Time Pin
Natza Mitzi30-Apr-09 9:58
Natza Mitzi30-Apr-09 9:58 
GeneralRe: Calculating with Time Pin
Henry Minute30-Apr-09 11:41
Henry Minute30-Apr-09 11:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.