drag and drop picture in richtextbox
-
how do i drag and drop a picture into richtextbox where i need to save that into the database sqlserver in wpf c# language?????.. also, how should i declare the the field in the datbase? thanks
You need to hook the RichTextBox's Drop Event[^]. As far as the field in the database, if you are using sqlserver there is a datatype called 'image' that you can use. Here[^] is an example doing just that.
Don't be overcome by evil, but overcome evil with good
-
You need to hook the RichTextBox's Drop Event[^]. As far as the field in the database, if you are using sqlserver there is a datatype called 'image' that you can use. Here[^] is an example doing just that.
Don't be overcome by evil, but overcome evil with good
hi.. thanks for reply.. but the link u provided is not i want.. the first link just provided me C# public event DragEventHandler Drop haha.. no more information.. also. i am doing this project in WPF i would like to know how do i drag in a picture or upload a picture into a RICHTEXTBOX where i am able to save the richtextbox's content into the database. just imagine writing a diary.. which got words and picture..after finish.. i save all into database. reallly thanks for the reply ..
-
hi.. thanks for reply.. but the link u provided is not i want.. the first link just provided me C# public event DragEventHandler Drop haha.. no more information.. also. i am doing this project in WPF i would like to know how do i drag in a picture or upload a picture into a RICHTEXTBOX where i am able to save the richtextbox's content into the database. just imagine writing a diary.. which got words and picture..after finish.. i save all into database. reallly thanks for the reply ..
-
the first link that i provided was for the wpf richtextbox. I guess i need more information. Why do you want to use a richtextbox for this? why not a listbox or listview?
Don't be overcome by evil, but overcome evil with good
hi.. thanks.. i found this link.. very useful.. hope it can help others as well.. http://blogs.vertigosoftware.com/alanl/archive/2006/11/30/4124.aspx?CommentPosted=true#commentmessage[^] however .. how do i save the pictures which is in wrappanel form into sql database? what i would like to do this to enable people to write diary.. as well as allow them to drag in the pictures into that wrap panel.. after they are done.. save into the database
-
hi.. thanks.. i found this link.. very useful.. hope it can help others as well.. http://blogs.vertigosoftware.com/alanl/archive/2006/11/30/4124.aspx?CommentPosted=true#commentmessage[^] however .. how do i save the pictures which is in wrappanel form into sql database? what i would like to do this to enable people to write diary.. as well as allow them to drag in the pictures into that wrap panel.. after they are done.. save into the database
To save the RichTextBox, you could do this:
myRichTextBox.SelectAll(); using (MemoryStream ms = new MemoryStream()) { myRichTextBox.Selection.Save(ms, DataFormats.Xaml); ms.Seek(0, SeekOrigin.Begin); using (StreamReader sr = new StreamReader(ms)) { string myXaml = sr.ReadToEnd(); SaveToDatabase(myXaml); } }
Deja View - the feeling that you've seen this post before.