ITextFont and c#

  • Thread starter Thread starter Ram
  • Start date Start date
R

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
 
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,

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 said:
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]
- (e-mail address removed)

Ram said:
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
 
I got it. It is in the property and not as a funtion. (missed probably due
to my vc background )

Ram
 
Back
Top