Help me please :( Je crack

scottmat Messages postés 438 Date d'inscription samedi 24 mai 2003 Statut Membre Dernière intervention 23 janvier 2011 - 15 juin 2006 à 15:15
scottmat Messages postés 438 Date d'inscription samedi 24 mai 2003 Statut Membre Dernière intervention 23 janvier 2011 - 15 juin 2006 à 16:35
Bonjours à tous,


dans un richtextbox j’insère une image à l’aide du code suivant :


 <?xml:namespace prefix o ns "urn:schemas-microsoft-com:office:office" /?>


 




 

Dim
a AsNew ClassRichtTextImg()






           
Dim OpenFilesMailing AsNew OpenFileDialog





 






            OpenFilesMailing.Filter = "Fichiers Bitmap (*.BMP)|*.BMP "






        










           
If OpenFilesMailing.ShowDialog = Windows.Forms.DialogResult.OK Then






                a.add_pictures_to_rtb(New Bitmap(OpenFilesMailing.FileName),
richtextbox1
,
richtextbox1
.SelectionStart)






           
End
If






 




Une fois que l’image est inséré comment puis-je l’identifier, pour par exemple au double click sur l’image afficher une boite de dialogue qui donnerai ses propriétés (taille, position, etc…)


Merci par avance ;)

2 réponses

Utilisateur anonyme
15 juin 2006 à 16:05
Salut,

Ben, la ca nous dis pas comment tu l'insére dans ta richtextbox mais comment tu l'ouvre.
Ajoute le code de ClassRichtTextImg.



Kenji

Merci de lire le règlement (vivement conseillé voir obligatoire).
/FONT>
0
scottmat Messages postés 438 Date d'inscription samedi 24 mai 2003 Statut Membre Dernière intervention 23 janvier 2011 1
15 juin 2006 à 16:35
oui désoler :





Public






Class
ClassRichtTextImg


Public



Sub
add_pictures_to_rtb(

ByVal
pic

As
Image,

ByVal
rtb

As
RichTextBox,

ByVal
index

As



Integer
)


Dim
a

As



Integer






Dim
b

As



Integer






Dim
tmpobj

As



Object

tmpobj = Clipboard.GetDataObject


Clipboard.SetDataObject(pic)


a = rtb.SelectionStart


b = rtb.SelectionLength


rtb.SelectionLength = 0


rtb.SelectionStart = index


rtb.Paste()


Clipboard.SetDataObject(tmpobj)







If
index >= a

Then
a +1rtb.SelectionStart a

rtb.SelectionLength = b


End



SubEnd





Class

méthode que j'ai repris ici meme qui fait appel au presse papier
0
Rejoignez-nous