Click here to Skip to main content
15,891,184 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to get cell value in gridView Pin
George L. Jackson21-Sep-07 12:25
George L. Jackson21-Sep-07 12:25 
QuestionTooltip Pin
babbelfisken21-Sep-07 9:08
babbelfisken21-Sep-07 9:08 
AnswerRe: Tooltip Pin
Chintan.Desai21-Sep-07 20:39
Chintan.Desai21-Sep-07 20:39 
QuestionThreading questions/advice sought Pin
martin_hughes21-Sep-07 8:55
martin_hughes21-Sep-07 8:55 
AnswerRe: Threading questions/advice sought Pin
Pete O'Hanlon21-Sep-07 9:17
mvePete O'Hanlon21-Sep-07 9:17 
GeneralRe: Threading questions/advice sought Pin
martin_hughes21-Sep-07 9:35
martin_hughes21-Sep-07 9:35 
AnswerRe: Threading questions/advice sought Pin
led mike21-Sep-07 9:48
led mike21-Sep-07 9:48 
QuestionPrinting and Formatting [modified] Pin
Michael Fritzius21-Sep-07 8:31
professionalMichael Fritzius21-Sep-07 8:31 
Hi all,

I've written a program where part of it will print a selected file to a printer. This file has tabs in certain places that are crucial to the output not looking wonky.

The output looks wonky. However, if I print it up using something like Notepad, it looks just fine. I'm using a generic filestream/printer handler to do the job. Is there a way for the tabs to be preserved?

Thanks for your time,
Michael Fritzius

//print the report<br />
 OpenFileDialog fdlg = new OpenFileDialog();<br />
 fdlg.Title = "C# Corner Open File Dialog";<br />
 fdlg.InitialDirectory = @"C:\ ";<br />
 fdlg.Filter = "Text files (*.txt | .txt | All files (*.*) | *.*";<br />
 fdlg.FilterIndex = 2;<br />
 fdlg.RestoreDirectory = true;<br />
 if (fdlg.ShowDialog() == DialogResult.OK)<br />
 {<br />
     textBox1.Text = fdlg.FileName;<br />
 }<br />
 string filename = textBox1.Text.ToString();<br />
 //Create a StreamReader object<br />
 reader = new StreamReader(filename);<br />
 //Create a Verdana font with size 10<br />
 verdana10Font = new Font("Arial", 10);<br />
 //Create a PrintDocument object<br />
 PrintDocument pd = new PrintDocument();<br />
 //Add PrintPage event handler<br />
 pd.PrintPage += new PrintPageEventHandler(this.PrintTextFileHandler);<br />
 //set up for landscape<br />
 pd.DefaultPageSettings.Landscape = true;<br />
 <br />
 //Call Print Method<br />
 pd.Print();<br />
 //Close the reader<br />
 if (reader != null)<br />
 {<br />
     reader.Close();<br />
 }



-- modified at 14:41 Friday 21st September, 2007
AnswerRe: Printing and Formatting Pin
Pete O'Hanlon21-Sep-07 9:26
mvePete O'Hanlon21-Sep-07 9:26 
GeneralRe: Printing and Formatting Pin
Luc Pattyn21-Sep-07 12:22
sitebuilderLuc Pattyn21-Sep-07 12:22 
AnswerRe: Printing and Formatting Pin
Michael Fritzius24-Sep-07 4:51
professionalMichael Fritzius24-Sep-07 4:51 
QuestionWindows Shutdown Pin
mobius11100121-Sep-07 5:56
mobius11100121-Sep-07 5:56 
AnswerRe: Windows Shutdown [modified] Pin
Anthony Mushrow21-Sep-07 6:21
professionalAnthony Mushrow21-Sep-07 6:21 
GeneralRe: Windows Shutdown Pin
Dave Kreskowiak21-Sep-07 6:36
mveDave Kreskowiak21-Sep-07 6:36 
GeneralRe: Windows Shutdown Pin
Anthony Mushrow21-Sep-07 6:48
professionalAnthony Mushrow21-Sep-07 6:48 
AnswerRe: Windows Shutdown Pin
Dave Kreskowiak21-Sep-07 6:34
mveDave Kreskowiak21-Sep-07 6:34 
AnswerRe: Windows Shutdown Pin
Matthew Cuba21-Sep-07 6:39
Matthew Cuba21-Sep-07 6:39 
QuestionArrhgg.. C++ DLLs make me angry.. [modified] Pin
Dio2221-Sep-07 5:40
Dio2221-Sep-07 5:40 
AnswerRe: Arrhgg.. C++ DLLs make me angry.. Pin
Paul Conrad21-Sep-07 16:46
professionalPaul Conrad21-Sep-07 16:46 
GeneralRe: Arrhgg.. C++ DLLs make me angry.. Pin
Dio2221-Sep-07 17:16
Dio2221-Sep-07 17:16 
AnswerRe: Arrhgg.. C++ DLLs make me angry.. Pin
Paul Conrad22-Sep-07 4:58
professionalPaul Conrad22-Sep-07 4:58 
GeneralRe: Arrhgg.. C++ DLLs make me angry.. Pin
Dio2222-Sep-07 8:50
Dio2222-Sep-07 8:50 
QuestionOleDbConnection question Pin
ForkOffandDie21-Sep-07 4:37
ForkOffandDie21-Sep-07 4:37 
AnswerRe: OleDbConnection question Pin
Colin Angus Mackay21-Sep-07 5:01
Colin Angus Mackay21-Sep-07 5:01 
GeneralRe: OleDbConnection question Pin
ForkOffandDie21-Sep-07 5:05
ForkOffandDie21-Sep-07 5:05 

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.