Share your opinion
WIDGETS GAMBAS
GAMBAS 3 SOFTWARES
TUTORIALS
Library
|
FORM WINDOW - drag picture beetween forms
DRAG AND DROP ENTRE DEUX FOMRULAIRES
Aujourd'hui nous allons voir un drag and drop entre deux forms avec gambas. fmain est composeé de :
voici les sources de fmain :1 drawarea, 1 picturebox, 1 bouton 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 ! TELECHARGER LES SOURCES DE L'EXEMPLE Creation date : 07/05/2009 @ 12:03 Reactions to this article
| QUICK MENU
SEARCH
LANGUAGE
COMPONENTS
Other
LANGUAGE
Where, who?
VISITS
visitors visitors online ARCHIVES GAMBAS 1/2
|