Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I insert an image in a RichTextBox by using a InlineUIContainer. Now I am trying to add some handlers to this image.

Here is my code:
C#
filepath = openFileDialog.FileName;
                Image img = new Image();
                BitmapImage bImg = new BitmapImage();
                img.IsEnabled = true;
                bImg.BeginInit();
                bImg.UriSource = new Uri(filepath, UriKind.Relative);
                bImg.EndInit();
                img.Source = bImg;
                img.MouseEnter += new MouseEventHandler(img_MouseEnter);
                img.Stretch = Stretch.Uniform;                                    
                   new InlineUIContainer(img, richMain.Selection.Start); 

However, when I move my mouse enter this image, nothing happen. What I'm trying to add are some handlers like resize, click, and drag and drop. Is it possible?

I appreciate for any answers.

Thanks!
Posted
Updated 20-May-13 3:47am
v4
Comments
BaiYiFan 22-May-13 22:23pm    
Anybody have any idea? Have anyone encountered the similar problem? I will thank you very much if you could talk about this question with me.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900