|
Hi everybody!
I have a little problem.
How can i get the length of a string in pixels!?
Like Form.TextWidth(<string>) in VB6.
Thanks
Vanclei Matheus
Brazil
MSN Msgr - vmatheus@msn.com
|
|
|
|
|
|
Tnx
Vanclei Matheus
Brazil
MSN Msgr - vmatheus@msn.com
|
|
|
|
|
I have a .idl file that describes a COM object. But how can I use it with C# ?
|
|
|
|
|
I'm looking for information about parsing a RichText file for printing with C#. Can anyone help with some information or a lead to finding more about this process?
Thanks,
Kyle
|
|
|
|
|
just load the rtf file in a richtextbox, and print it, very easy
|
|
|
|
|
Hi Leppie,
I have the rtf file loaded into a richtextbox and I can print it as a standard text document without formatting or graphics but cannot yet print it with formatting and graphics. Can you tell me how to do this complete with formatting and graphics?
Kyle
|
|
|
|
|
i assume u used this method to load the file?
richTextBox1.LoadFile(@"C:\MyDocs\Testdoc.txt",
RichTextBoxStreamType.RichText);
do u see it in the application as it should be printed?
|
|
|
|
|
Yes, I use the LoadFile method to load the file except I use the rtf extension for the filename, richTextBox1.LoadFile(@"C:\MyDocs\Testdoc.rtf"); and it does render properly in the richTextBox1. I can change the formatting, cut and paste images, save and reload the file and it always renders properly to the screen complete with images and formatting. I would like to print what I see on the screen. Actually I want to add the richTextBox contents to the end of a report I am already successfully printing. I can send the richtext formatting code to a stream and thought I might have to parse it to convert it the the proper information to feed the drawstring methods for printing. But I will appreciate any other options as well that will allow me to print the rtf document. Thanks for your help.
Kyle
|
|
|
|
|
hi
thx for all the info, i havent , well cant try this at the moment, i have no printer
there is very good printing examples in the code of the book GDI Plus (chapter 9) . u can download it at www.wrox.com .
hope u that helps
perhaps u are just missing a line or 2
PS: i see NOW that u need to paint the contents of the richtextbox to the derived graphics object from the PrintPage event. from msdn:
Handle the PrintPage event where you specify the output to print, by using the Graphics included in the PrintPageEventArgs.
the problem is to "paint" the content correctly to the graphics object. sorry, at the moment i cant help u anymore
|
|
|
|
|
hello,
I have a question:
I have a written html page with image. when the user click on it i want it to raise event,I do not want to handle it throw the asp.
I dont want to write:
I want to handle the onclick event in my aspx.cs file
how can I do it?
thank you very much for your help,
sharon
|
|
|
|
|
If you want to handle it on the server instead of the client you have to make it a server object. Offhand I'm not certain an IMG raises a server side click event but I am fairly certain an Input type="Image" does.
Then just make sure and add the event handler code inside your .cs .
BTW: for next time this is an ASP/ASP.NET question and should go there.
|
|
|
|
|
thank you very much ,
i'll try it later.
sharon.
|
|
|
|
|
Hi,
I want to use Functions from the Dll which is not Dot Net Dll,a normal Win32 Dll in VC#.
How should i use the functions of external Dll in VC# code?
Thanx n Regards
Tushar
|
|
|
|
|
|
here some code i used for the winamp api
<br />
[DllImport("user32.dll")]<br />
public static extern int FindWindow(string c,int d);<br />
[DllImport("user32.dll")]<br />
public static extern int SendMessage(int hWnd,int msg, int wparam, int lparam);<br />
Now just call though functions normal.
hope it helps
|
|
|
|
|
Thank u very much now i will try it for my Dll.
Thanx again.
Tushar
|
|
|
|
|
I want to do the opposite. Maybe you know the way. I want to use a dll created in c#, in vb6.
Thnx
NSi
|
|
|
|
|
tell me when u figure that one out
|
|
|
|
|
You need to use the regasm tool to register the C# objects as COM objects; then you should be able to use it from VB6 as you would any other COM object.
HTH,
James
"Java is free - and worth every penny." - Christian Graus
|
|
|
|
|
I can find "System.Management" in msdn, but my VS.net reports error:
D:\Data\Source\C#\CodeProject\Project1\App.cs(2): The type or namespace name 'Management' does not exist in the class or namespace 'System' (are you missing an assembly reference?)
Thanks for your help
///////////////////////////////////////////////////////////////////////////////////
// Platform: IBM thinkpad x21
// OS:Microsoft Windows 2000 5.00.2195 SP2
// Mircosoft Development Environment 2002 version 7.0.9466
// Mircosoft .Net Framework 1.0 version 1.0.3705
///////////////////////////////////////////////////////////////////////////////////
I'm amumu, and you?
|
|
|
|
|
Hi
You need to reference the System.Management.dll either in VS.Net by adding it to references in your project or at comman line when compiling.
|
|
|
|
|
Thankyou
I got it
I'm amumu, and you?
|
|
|
|
|
How in the F*** do you get the hInstance property of your dll? I need it to use the Bitmap class' FromResource method.
Thanks in advance.
Jamie Nordmeyer
Portland, Oregon, USA
|
|
|
|
|