Click here to Skip to main content
15,915,818 members
Home / Discussions / C#
   

C#

 
GeneralRe: How can we read XML line by line ? Pin
Guffa12-Jul-08 8:24
Guffa12-Jul-08 8:24 
GeneralRe: How can we read XML line by line ? Pin
Mohammad Dayyan12-Jul-08 10:37
Mohammad Dayyan12-Jul-08 10:37 
AnswerRe: How can we read XML line by line ? Pin
PIEBALDconsult11-Jul-08 16:32
mvePIEBALDconsult11-Jul-08 16:32 
AnswerRe: How can we read XML line by line ? Pin
Elroy Dsilva11-Jul-08 21:43
Elroy Dsilva11-Jul-08 21:43 
QuestionSend Mail Confirmation Pin
ctrlnick11-Jul-08 10:40
ctrlnick11-Jul-08 10:40 
AnswerRe: Send Mail Confirmation Pin
leppie11-Jul-08 11:17
leppie11-Jul-08 11:17 
AnswerRe: Send Mail Confirmation Pin
Nadia Monalisa11-Jul-08 13:07
Nadia Monalisa11-Jul-08 13:07 
QuestionExtract image(s) from richTextBox Pin
bob200811-Jul-08 9:40
bob200811-Jul-08 9:40 
I want to extract the images from a richTextBox and save them to a file or files.

I tried using code snippets from this and other sites without any luck.

[DllImport("user32.dll", EntryPoint = "OpenClipboard", SetLastError = true, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
public static extern bool OpenClipboard(IntPtr hWnd);

[DllImport("user32.dll", EntryPoint = "GetClipboardData", SetLastError = true, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
public static extern IntPtr GetClipboardData(int uFormat);

[DllImport("user32.dll", EntryPoint = "EnumClipboardFormats", SetLastError = true, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
public static extern int EnumClipboardFormats(int i);
private void button1_Click(object sender, EventArgs e)
 {
     //Copy the contents of the rich textbox to the clipboard
     richTextBox1.Copy();

     //Open the clipboard
     if (OpenClipboard(this.Handle))
     {
         //int i = 0;
         //bool done = false;
         //int[] formats = new int [10];
         //while (! done)
         //{
         //    formats[i] =  EnumClipboardFormats(i);
         //    if (formats[i] == 0) done = true;
         //    i++;
         //}

         Metafile MF = new Metafile(GetClipboardData(2), true);
         MF.Save("C:\\Temp\\MF.bmp", ImageFormat.Bmp);
     }

 }

When all that I copy into the richTextBox is an image (from the clipboard using alt-Print Screen), the commented out loop returns only one format = 2. The attempt to create the Metafile generates the following error: A generic error occurred in GDI+.

Any suggestions? Thanks.
QuestionAny MultiPage Control available for Windows Form ? Pin
Nadia Monalisa11-Jul-08 7:58
Nadia Monalisa11-Jul-08 7:58 
AnswerRe: Any MultiPage Control available for Windows Form ? Pin
Luc Pattyn11-Jul-08 8:17
sitebuilderLuc Pattyn11-Jul-08 8:17 
GeneralRe: Any MultiPage Control available for Windows Form ? Pin
Nadia Monalisa11-Jul-08 8:52
Nadia Monalisa11-Jul-08 8:52 
GeneralRe: Any MultiPage Control available for Windows Form ? Pin
Luc Pattyn11-Jul-08 9:10
sitebuilderLuc Pattyn11-Jul-08 9:10 
GeneralRe: Any MultiPage Control available for Windows Form ? Pin
Nadia Monalisa11-Jul-08 9:51
Nadia Monalisa11-Jul-08 9:51 
GeneralRe: Any MultiPage Control available for Windows Form ? Pin
DaveyM6911-Jul-08 10:02
professionalDaveyM6911-Jul-08 10:02 
GeneralRe: Any MultiPage Control available for Windows Form ? Pin
Luc Pattyn11-Jul-08 10:10
sitebuilderLuc Pattyn11-Jul-08 10:10 
GeneralRe: Any MultiPage Control available for Windows Form ? Pin
Nadia Monalisa11-Jul-08 10:24
Nadia Monalisa11-Jul-08 10:24 
GeneralRe: Any MultiPage Control available for Windows Form ? Pin
Luc Pattyn11-Jul-08 10:34
sitebuilderLuc Pattyn11-Jul-08 10:34 
GeneralRe: Any MultiPage Control available for Windows Form ? Pin
Nadia Monalisa11-Jul-08 11:32
Nadia Monalisa11-Jul-08 11:32 
AnswerRe: Any MultiPage Control available for Windows Form ? Pin
Gareth H11-Jul-08 10:14
Gareth H11-Jul-08 10:14 
QuestionUpdate Control Panel from Control Button Pin
lcm111-Jul-08 7:36
lcm111-Jul-08 7:36 
AnswerRe: Update Control Panel from Control Button Pin
Luc Pattyn11-Jul-08 8:42
sitebuilderLuc Pattyn11-Jul-08 8:42 
QuestionDocking/Anchoring controls Pin
Echilon11-Jul-08 6:55
Echilon11-Jul-08 6:55 
AnswerRe: Docking/Anchoring controls Pin
paas11-Jul-08 8:17
paas11-Jul-08 8:17 
AnswerRe: Docking/Anchoring controls Pin
Luc Pattyn11-Jul-08 8:36
sitebuilderLuc Pattyn11-Jul-08 8:36 
AnswerRe: Docking/Anchoring controls Pin
Echilon11-Jul-08 9:09
Echilon11-Jul-08 9:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.