Page loading

Share your opinion
What do you think about gambaslinux.fr?
 
Interesting
It miss some informations
Excellent website
Results
WIDGETS GAMBAS
GAMBAS 3 SOFTWARES
TUTORIALS
Library
FORM WINDOW - drag picture beetween forms

DRAG AND DROP ENTRE DEUX FOMRULAIRES


dragentre2form.jpg


Aujourd'hui nous allons voir un drag and drop entre deux forms avec gambas.


fmain est composeé de :
1 drawarea, 1 picturebox, 1 bouton
 
voici les sources de fmain :

PUBLIC SUB _new()
END

PUBLIC SUB Form_Open()
Form1.Show
ME.Center
END

PUBLIC SUB Button1_Click()
QUIT
END

PUBLIC SUB PictureBox3_MouseDrag()
'drag even
  IF Mouse.Left THEN
    Drag.Icon = LAST.Picture
     PictureBox3.Visible = FALSE
    LAST.Drag(LAST.Picture.Image)
  ENDIF

END

PUBLIC SUB DrawingArea1_Drop()
'drop receive picturebox1 on form1 or picturebox3 on fmain
'recupere les coordonnees x et y de l_image
PictureBox3.X = Drag.X
PictureBox3.Y = Drag.Y
'recupere limage
PictureBox3.Picture = drag.icon
PictureBox3.Visible = TRUE
END

et dans la Form1 nous aurons :
1 drawarea, 1 pictureBOX
Voici le code :
PUBLIC SUB DrawingArea1_Drop()
'receive picture x and y
PictureBox1.X = Drag.X
PictureBox1.Y = Drag.Y
'receive image
PictureBox1.Picture = drag.icon
PictureBox1.Visible = TRUE
END

PUBLIC SUB PictureBox1_MouseDrag()
'drag even
  IF Mouse.Left THEN
    Drag.Icon = LAST.Picture
     PictureBox1.Visible = FALSE
    LAST.Drag(LAST.Picture.Image)
  ENDIF
END

Une fois le concept assimilé, cela est très simple.
A bientôt !
wink

TELECHARGER LES SOURCES DE L'EXEMPLE


 

Creation date : 07/05/2009 @ 12:03
Last update : 12/02/2012 @ 10:41
Category : FORM WINDOW
Page read 6117 times


Print the article Print the article


react.gifReactions to this article

Nobody gave a comment yet.
Be the first one to do it!


QUICK MENU
SEARCH




LANGUAGE
COMPONENTS
Other
LANGUAGE
Where, who?
VISITS

   visitors

   visitors online

ARCHIVES GAMBAS 1/2
^ Top ^