|
hi all,
I am using DocumentViewer Class which exports
print method only..I need to have a print preview option too in the winfx application.
What's the right way to do this ? I am using vc# 2005
I also need suggestion for the following method
In the Handler for print preview menu, I have a
private void OnPrintPreview( )
{
System.Windows.Forms.PrintPreviewDialog prev = new System.Windows.Forms.PrintPreviewDialog();
prev.document = //Here, How can I get the PrintDocument from DocumentViewer
prev.ShowDialog()
}
DocumentViewer's document member variable is of type
IDocumentPaginitorSource. Pls let me know how to get
System.Drawing.Printing.PrintDocument type from IDocumentpaginitor.
Thanks,
|
|
|
|
|
I am a novice at C# and was wondering if there is a way to implement a find function in a RichTextBox. I have been thus far able to find the text and even change the color of the text when found. However I was wondering if it is possible to move the window focus to where the text was found, much like in a word processor.
|
|
|
|
|
If you know what you want to select, say characters 42 through 51, then you can do the following in your search method.
myRichTextBox.Focus();
myRichTextBox.Select( start, length );
I hope that helps.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
You're looking for the RTB's ScrollToCaret[^] method. So long at the RTB's SelectionStart property it set to where you want to scroll and the RTB has the Focus, this method will work.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi
Does anyone have an example to print a statement?
Thank you,
D
|
|
|
|
|
Hi,
where did you have your statement if it is in aspx page write the following code on body onload event, it will automatically print this page.
Thanks
Warm Regards
Prakash-B
|
|
|
|
|
|
Hello,
You can get the CurrencyManager and access its Count property.
CurrencyManager cm = dataGrid.BindingContext[dataGrid.DataSource] as CurrencyManager;<br />
if(cm != null)<br />
int count = cm.List.Count;
HTH. Cheers
Maqsood Ahmed - MCAD.net
Kolachi Advanced Technologies
http://www.kolachi.net
|
|
|
|
|
:(It is not working for me.If i'm having 2 rows the count is showing as 1 ???
Anup
|
|
|
|
|
in MFC if I wanted a hex value in a string I could put in \x04. How do I add hex to a string in C#. Do I do it the same?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Yes.
You can also use Unicode. "\u0082" == "\x82".
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
I need to create a program that reads in bar codes. Would you be able to suggest how I might go about that task? Thanks
|
|
|
|
|
Most bar code readers stand in between the end-user and the keyboard. So that when you scan a barcode it's as if they typed in the numbers on a keyboard. So just place your cursor where it needs to go and scan a bar code. It should fill. I've tried this with the USB as well as the PS2 barcode readers. The PS2 connects to the keyboard PS2 port on the PC and then with a "Y" cable that the keyboard plugs into.
Good luck
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Thank you. That will make life relatively easy for me.
|
|
|
|
|
I've writtne a program that receives a string via TCP/IP. This string is made up of different data fixed fields. Sort of like thisissomedatablahblahblah. So if I know the field lenghts is there a way to copy data starting at a particular spot and reading for a particular length and returning that data?
Something like ReadTo(6, 4) which would return the word "some".
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Look at the Substring method of the string class.
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
There is a methode you can use for that.
Here is an example from the one you wrotte :
int startIndex = 6;
int Length = 4;
string MyString = "thisissomedatablahblahblah";
string SubString = MyString.Substring(startIndex, Length);
Hop that can help
|
|
|
|
|
Hi,
I'm trying to search a datagrid/datatable using string.Compare , and doing something wrong when trying to use wildcards. I have searchThis as the string to search for, which works fine with string.Compare(search, searchThis); . But when I try to make searchThis = "*" + searchThis + "*"; it doesn't work. I'm sure it's pretty simple, but haven't been able to find the answer yet.
Thanks for any help!
Mel
|
|
|
|
|
The Compare method doesn't support wildcards.
If you want to search entire strings with wildcard support, you'll have to use Regular Expressions[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
I am trying to display a number with two places to right of decimal. When the number diplays it truncates the trailling zero. I want to see .50 but I see .5
after I changed my datatype in the database to decimal from float. the number shows up like 2.25000009944
can someone tell me how do I display 1.50 with the zero in the database and the UI (web form). I tried looking for formatting in help but i can seem to get it right.
Thanks
|
|
|
|
|
Hi,
I think you should look around string.Foramt() methode which can have parameter like NumberFormatInfo MSDN
Or, like this example, you can use the ToString() methode :
string NumberPrettyPrint(int number){
NumberFormatInfo nfi = new CultureInfo( "en-US", false ).NumberFormat;
nfi.NumberDecimalDigits = 2;
return number.ToString("N", nfi);
}
Hope that can help
|
|
|
|
|
I have loaded crystal report with a line graph in C#. now i want to change graph from line graph to bar or any other graph using C# code.what should i do.in other words i want to pass chart type from C# to crystal report . Have any body some idea about it
|
|
|
|
|
Hi,
It's been a while since I've posted in here!
Last Time I was using Visual Studio 2003.NET and mainly using C# Version 1.1
and C++.NET 1.1.
I'll be getting Visual Studio 2005 this week hopefully.
I know it came out in November, but Im not from the US, good ole England, and we're just getting over here.
Amazon UK Visual Studio 2005 Release Date : January 27, 2006 -
Visual Studio 2005 @ Amazon UK
I'm now coding in C# 2.0, using Visual C# Express and Visual Basic.Net Express
and hopefully moving onto C++.NET 2.0 as well. The Managed Framework looks wicked!
Anyway all that has nothing to do with why im posting.
Im trying to write a Plugin for MSN Messenger Plus plugin that changes the personal message like the 'What I'm Listening To' when you use Windows Media Player or Itunes.
I've seen a .NET plugin that changes the nick, but i'm wondering if anyone has found out how to change the personal message. Any .NET Language will be fine.
Thanks Tom
|
|
|
|
|
Its Okay!
I did look around and saw documentation for something called Toaster!
I thought this would bringing up a dialog box in MSN Messenger toasting to someone!
But the actual feature for the personal message is called Toaster, so its okay.
But please provide content if you like.
Thanks again
Tom
|
|
|
|