Click here to Skip to main content
15,893,381 members
Home / Discussions / C#
   

C#

 
GeneralRe: Displaying long string in tab page label Pin
Heath Stewart8-May-04 19:42
protectorHeath Stewart8-May-04 19:42 
GeneralOverriding OpenFileDialog Pin
MrEyes7-May-04 13:10
MrEyes7-May-04 13:10 
GeneralRe: Overriding OpenFileDialog Pin
CWIZO7-May-04 20:59
CWIZO7-May-04 20:59 
GeneralRe: Overriding OpenFileDialog Pin
Heath Stewart8-May-04 19:34
protectorHeath Stewart8-May-04 19:34 
GeneralRe: Overriding OpenFileDialog Pin
Heath Stewart8-May-04 19:37
protectorHeath Stewart8-May-04 19:37 
GeneralRe: Overriding OpenFileDialog Pin
CWIZO8-May-04 19:46
CWIZO8-May-04 19:46 
QuestionGraphic problem? Pin
Alan Zhao7-May-04 11:48
Alan Zhao7-May-04 11:48 
AnswerRe: Graphic problem? Pin
kayhustle7-May-04 14:19
kayhustle7-May-04 14:19 
This is how you save something. Lets just say the class UI is the user control that you want to save. Printing is a bit more complicated. I gotta go now, but if I come back and nobody has answered I will show you.
//Lets say this is the user control you want to save or print<br />
	public class UI:System.Windows.Forms.UserControl<br />
	{<br />
		public void UI_Paint(object sender, System.Windows.Forms.PaintEventArgs e)<br />
		{<br />
			//code to paint to e.Graphics<br />
		}			<br />
		public event PaintEventHandler paint = new PaintEventHandler(UI_Paint);<br />
		public void Save()<br />
		{<br />
			<br />
			//Pretty straightforward, get a new bitmap equal to the same size<br />
			Bitmap b = new Bitmap(this.Width,this.Height,this.CreateGraphics());<br />
			PaintEventArgs pe = new PaintEventArgs(Graphics.FromImage(b),this.ClientRectangle);<br />
			//raise the paint event but paint to the bitmap<br />
			paint(this,pe);<br />
			b.Save("filename",System.Drawing.Imaging.ImageFormat.Jpeg);<br />
		}<br />
			}<br />
}

You can save it to any format you want, there are quite a few you can pull from ImageFormat.
GeneralUpload Very Large Files to SQL Server Pin
Adam Hable7-May-04 11:42
Adam Hable7-May-04 11:42 
GeneralRe: Upload Very Large Files to SQL Server Pin
leppie7-May-04 13:49
leppie7-May-04 13:49 
GeneralRe: Upload Very Large Files to SQL Server Pin
Colin Angus Mackay7-May-04 23:59
Colin Angus Mackay7-May-04 23:59 
Questionhow can I get post or get data that send by "Microsoft Web Browser" Pin
Renegade_c7-May-04 11:12
Renegade_c7-May-04 11:12 
GeneralPassing Public int Variable to Win Form Pin
Dave Brighton7-May-04 10:53
Dave Brighton7-May-04 10:53 
GeneralRe: Passing Public int Variable to Win Form Pin
Colin Angus Mackay7-May-04 13:02
Colin Angus Mackay7-May-04 13:02 
GeneralRe: Passing Public int Variable to Win Form Pin
Dave Brighton7-May-04 14:11
Dave Brighton7-May-04 14:11 
GeneralRe: Passing Public int Variable to Win Form Pin
Colin Angus Mackay7-May-04 23:49
Colin Angus Mackay7-May-04 23:49 
GeneralRe: Passing Public int Variable to Win Form Pin
Dave Brighton8-May-04 6:12
Dave Brighton8-May-04 6:12 
GeneralRe: Passing Public int Variable to Win Form Pin
Colin Angus Mackay8-May-04 6:48
Colin Angus Mackay8-May-04 6:48 
GeneralChanging the fugly Setup Wizard icon in MSI files. Pin
Tony Archer7-May-04 9:14
Tony Archer7-May-04 9:14 
GeneralRe: Changing the fugly Setup Wizard icon in MSI files. Pin
Heath Stewart7-May-04 9:45
protectorHeath Stewart7-May-04 9:45 
GeneralRe: Changing the fugly Setup Wizard icon in MSI files. Pin
Tony Archer7-May-04 13:54
Tony Archer7-May-04 13:54 
GeneralPassing collection via Web Services Pin
Diego F.7-May-04 8:32
Diego F.7-May-04 8:32 
GeneralRe: Passing collection via Web Services Pin
Heath Stewart7-May-04 9:40
protectorHeath Stewart7-May-04 9:40 
GeneralRe: Passing collection via Web Services Pin
Diego F.7-May-04 12:33
Diego F.7-May-04 12:33 
GeneralRe: Passing collection via Web Services Pin
Heath Stewart8-May-04 19:27
protectorHeath Stewart8-May-04 19:27 

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.