|
How can I start With RTF ???
How It will help me to write the data to a file???
How can I print the data from the file , after I saved the file???
please HELP ME , I mast know some start of what you write to me.
galigal156
|
|
|
|
|
One simple way is that when you save text in RTF format you can then load it in MSWord or any other word processor and print them out. If you want to add RTF viewer or editor to your project then make a new form and add Rich text box to you form and by calling its methods you can manipulate all the things required.
Here is an example.
public void CreateMyRichTextBox()<br />
{<br />
RichTextBox richTextBox1 = new RichTextBox();<br />
richTextBox1.Dock = DockStyle.Fill;
<br />
<br />
richTextBox1.LoadFile("C:\\MyDocument.rtf");
richTextBox1.Find("Text", RichTextBoxFinds.MatchCase);
<br />
richTextBox1.SelectionFont = new Font("Verdana", 12, FontStyle.Bold);
richTextBox1.SelectionColor = Color.Red;
<br />
richTextBox1.SaveFile("C:\\MyDocument.rtf", RichTextBoxStreamType.RichText);
<br />
this.Controls.Add(richTextBox1);
}<br />
For printing checkout PRINTDIALOGUE properties. You have to bind the print dialogue to you page.
Here is an example.
<br />
private System.Drawing.Printing.PrintDocument docToPrint = <br />
new System.Drawing.Printing.PrintDocument();<br />
<br />
private void Button1_Click(System.Object sender, <br />
System.EventArgs e)<br />
{<br />
<br />
PrintDialog1.AllowSomePages = true;<br />
<br />
PrintDialog1.ShowHelp = true;<br />
<br />
PrintDialog1.Document = docToPrint;<br />
<br />
DialogResult result = PrintDialog1.ShowDialog();<br />
<br />
if (result==DialogResult.OK)<br />
{<br />
docToPrint.Print();<br />
}<br />
<br />
}<br />
<br />
private void document_PrintPage(object sender, <br />
System.Drawing.Printing.PrintPageEventArgs e)<br />
{<br />
<br />
<br />
string text = "In document_PrintPage method.";<br />
System.Drawing.Font printFont = new System.Drawing.Font<br />
("Arial", 35, System.Drawing.FontStyle.Regular);<br />
<br />
e.Graphics.DrawString(text, printFont, <br />
System.Drawing.Brushes.Black, 10, 10);<br />
}<br />
<br />
<br />
Mujtaba
|
|
|
|
|
But now how can I print a table in this file ? ? ?
Or - I need to save for another file ex ? ? ?
Do you have an idea what can I do ? ? ?
The code you write down:
<br />
private void document_PrintPage(object sender, <br />
System.Drawing.Printing.PrintPageEventArgs e)<br />
{<br />
<br />
<br />
string text = "In document_PrintPage method.";<br />
System.Drawing.Font printFont = new System.Drawing.Font<br />
("Arial", 35, System.Drawing.FontStyle.Regular);<br />
<br />
e.Graphics.DrawString(text, printFont, <br />
System.Drawing.Brushes.Black, 10, 10);<br />
}<br />
*************************************************
This code I use with all my poject.
for text,line's,square....
That does not work so good.
|
|
|
|
|
|
Can I insert text\shape in Location X Y in milimetr's ? ? ?
|
|
|
|
|
Read out the documentation you would find everything you want.
The best place for this is MSDN.
Go to microsoft.com and you will find alot.
Mujtaba
|
|
|
|
|
I writ a code that print table + data to the printer.
I have laser printer with 64M memory.
but when I send to the printer about 500 pages I have a Problem.
about 50 pages the spooler of winXP start goes slowly.
what can I do ?
I have The Same code In VB and hi works More Good - but In WIN98.
Can I pass The spooler?
Can I writ The data to file and then send it to print?
can I save the table in "System.Drawing.Printing.PrintPageEventArgs"
and add to this event any time data????
Can I writ In PS???
|
|
|
|
|
HI
i make a search function.and this search function bind with a Thread.
as i click on the search button threat start and searching continu.But
i also put a animation control that animate as searching continue .
But problem is this after complete the search the animation control also moving.And i do't gettting where the thread ends.
How can i stop animation control as search complete
Parshant
|
|
|
|
|
Use one of the many signaling mechanisms possible to notify the other thread of this thread's completion. The simplest way is to use a boolean variable
volatile bool continueAnimation = true;
void AnimationFunc()
{
while (continueAnimation)
{
}
}
void ThreadFunc()
{
continueAnimation = false;
}
|
|
|
|
|
Hey all, I have a few realy importent questions that are pausing my program.
I REALY need some help, pleaseeeeee help!
1. I need to do a program, that when I tell it to, it will restart the program and update from the click-once auto-update.
How is it possible from inner-C# programming? (from inside the program - events)
2. I have an IP of a counter-strike server.
I need to check if the server exists (responding), and if it does, to check if it has password (and if possible to check if the password is correct by what I give it), and the num of ppl playing atm.
These three are for the ones that know how to use a Thresher's SharkBite.IRC library:
3. How can I easly see if a user is in a channel, from a UserInfo sent in a PrivateMessage?
4. How can I check a state (@p, Vo+ced or regular) of a user, from a UserInfo sent in a PublicMessage?
5. How can I change my usermode to +x if I don't have a usermode like that?
If you can provide a snifft of a part of code that would help even more!
Thanks ALOT!
NaNg.
|
|
|
|
|
2. I have an IP of a counter-strike server.
---- and you want to do a counter-strike hacker?
|
|
|
|
|
Not at all. I'm currently building a bot that ppl msg him an ip, and I wanna check if it exists, so they didn't fool it.
|
|
|
|
|
Hi,
I want to draw my own graphs in a WinForm, but I don't want to draw directly on the
Form. Which control is best to draw inside of? Picture Box? Panel? etc...
thanks for help...
|
|
|
|
|
Your best bet is to write your own control which draws it directly. A picture box is only good if you write the code to generate a bitmap with your graph, and use a picture box to display it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Typically if you need a blank control to draw on, inherit one from System.Windows.Forms.Control, or draw on a panel.
|
|
|
|
|
|
Hi,
I have a field in a db that is boolean. This is linked to a combobox.text that has two items to select from - Yes & No. All I want is for the combobox.text display to show Yes or No - not true or false. I know its cosmetic but I must design to the lowest common denominator.
Suggestions please
Glen Harvy
|
|
|
|
|
Write a database requery that returns the word Yes or No based on the bool value, and then write the code to store values that convert back to a bool based on those strings ( assuming the values have to go back, seeing as you have a combo box ).
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Be easier to convert the field to text and record Yes or No. Instead of testing/selecting the field based on boolean, check to see if text is Yes or No.
The reason for posting the message was because some programs (and I thought I had done it with VS but I may be wrong) allow you to chose the display ie True/False, Yes/No, Wright/Wrong and if empty/null then display MayBe/Dunno/Perhaps
Glen Harvy
|
|
|
|
|
Glen Harvy wrote: Be easier to convert the field to text and record Yes or No
Yes, but that would suck as far as the database is concerned, especially if you ever filter on this field.
You could just write a combobox that renders the words Yes/No based on a bool property.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian Graus wrote: You could just write a combobox that renders the words Yes/No based on a bool property.
I guess we're getting back to where we started
Glen Harvy
|
|
|
|
|
Sort of, but now I'm advocating an approach that doesn't change the data layer at all. Just have a control that renders whatever text you set based on a bool property.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
hi
i am create dataset in dataset designer and fill my dataset with GetData method that was created in dataset designer but when i create insert or update or delete method from add query in dataset designer and use it nothing works .(insert - update - delete methods not work) how to solve my problem ? and can u take me an article that use tableAdapter in vs2005 with source code ?
thanks...
|
|
|
|
|
Hi guys,
I need some help please, I have a listbox with a few rows filled, I am trying to create one string with all data in the list box and adding that string to the database table.
while(lbSelBranches.SelectedItems.Count!=0 || lbSelBranches.Items.Count!=0)
{
lbSelBranches.SelectedIndex=0;
lbSelBranches.Items.Remove(lbSelBranches.SelectedItem);
}
I have the above code, I need help figuring out how to keep inserting data into one string and than outputting in one line the string data, i.e. insert the string into one field of the database.
Please help
sasa
|
|
|
|
|
SASA_1 wrote: how to keep inserting data into one string
Sounds like you want a stringbuilder ?
SASA_1 wrote: insert the string into one field of the database.
Well, once it's a single string, you'd do that in the normal way.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|