473,396 Members | 1,895 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

ITextFont and c#

Ram
I am working with Richtextbox and tom in c#. Everything works fine, but I am
unable to get the ITextFont object from the IDocument interface nor do I see
functions GetFont and SetFont in ITextRange and ITextSelection. What's
wrong? Found that windows2000 has default Richedit 3.0 ( Riched20.dll.)and I
am working in 2000 professional..

Thanks and Regards
Ram

Nov 16 '05 #1
3 1681
Ram,

These are COM interfaces, right? Have you imported the COM interfaces
into your program? If so, then you will have to get the interface from the
windows control (which you should probably be able to get through a message
to the rich textbox).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ram" <ra*********@hotmail.com> wrote in message
news:uu**************@TK2MSFTNGP10.phx.gbl...
I am working with Richtextbox and tom in c#. Everything works fine, but I
am
unable to get the ITextFont object from the IDocument interface nor do I
see
functions GetFont and SetFont in ITextRange and ITextSelection. What's
wrong? Found that windows2000 has default Richedit 3.0 ( Riched20.dll.)and
I
am working in 2000 professional..

Thanks and Regards
Ram

Nov 16 '05 #2
Ram
Nicholas,

Yes. tom or Text Object Model is COM interface for Richtext edit box. I got
the interface be sending a message to the Rich text box. I got the IDocument
interface which is the parent of ITextRange, ISelectedRange,IFont etc.
I could also get teh instance of ITextRange and other interface from teh
IDocument interface. Now, when I worked with vc++, i could get the IFont
from ITextRange interface. But in C# I could not get the interface. Also
when in vc++, I Could invoke a function ITextRange::GetFont() to get the
present font. But in c#, the ITextRange instance does not have the GetFont
function at all.

I have included the tom COM component through the addreference. Is there any
other way to import the COM interfaces through code? Kindly help.

Thanks
Ram

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:eJ**************@tk2msftngp13.phx.gbl...
Ram,

These are COM interfaces, right? Have you imported the COM interfaces
into your program? If so, then you will have to get the interface from the windows control (which you should probably be able to get through a message to the rich textbox).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ram" <ra*********@hotmail.com> wrote in message
news:uu**************@TK2MSFTNGP10.phx.gbl...
I am working with Richtextbox and tom in c#. Everything works fine, but I
am
unable to get the ITextFont object from the IDocument interface nor do I
see
functions GetFont and SetFont in ITextRange and ITextSelection. What's
wrong? Found that windows2000 has default Richedit 3.0 ( Riched20.dll.)and I
am working in 2000 professional..

Thanks and Regards
Ram


Nov 16 '05 #3
Ram
I got it. It is in the property and not as a funtion. (missed probably due
to my vc background )

Ram

"Ram" <ra*********@hotmail.com> wrote in message
news:uu**************@TK2MSFTNGP10.phx.gbl...
I am working with Richtextbox and tom in c#. Everything works fine, but I am unable to get the ITextFont object from the IDocument interface nor do I see functions GetFont and SetFont in ITextRange and ITextSelection. What's
wrong? Found that windows2000 has default Richedit 3.0 ( Riched20.dll.)and I am working in 2000 professional..

Thanks and Regards
Ram

Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.