Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / June 2005

Tip: Looking for answers? Try searching our database.

IFont <-> System::Drawing::Font

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Phil Atkin - 24 Jun 2005 12:45 GMT
(Posted here because nobody wants to answer me in framework.interop, and I
_am_ using VC++!)

IFont to System::Drawing::Font is easy enough: get the hFont property and
then use Font::FromHfont.

But how can I go from a Font to a corresponding IFont?

TIA

Phil Atkin
Jochen Kalmbach [MVP] - 24 Jun 2005 12:55 GMT
Hi Phil!

> IFont to System::Drawing::Font is easy enough: get the hFont property and
> then use Font::FromHfont.
>
> But how can I go from a Font to a corresponding IFont?

See: OleCreateFontIndirect
http://msdn.microsoft.com/library/en-us/com/html/9ab384d6-fc21-4152-a0cf-744948f
2f72c.asp


Signature

Greetings
  Jochen

   My blog about Win32 and .NET
   http://blog.kalmbachnet.de/

Jochen Kalmbach [MVP] - 24 Jun 2005 13:07 GMT
>> But how can I go from a Font to a corresponding IFont?
>
> See: OleCreateFontIndirect
> http://msdn.microsoft.com/library/en-us/com/html/9ab384d6-fc21-4152-a0cf-744948f
2f72c.asp
 

For an example see here:
http://www.experts-exchange.com/Programming/Programming_Languages/MFC/Q_20265861.html

Signature

Greetings
  Jochen

   My blog about Win32 and .NET
   http://blog.kalmbachnet.de/

Phil Atkin - 24 Jun 2005 14:10 GMT
OleCreateFontIndirect: thanks; I was afraid of that...

I haven't seen the example (don't subscribe to Experts Exchange - is it
worth it?) but it seems like hard work to unpick all the properties of an
existing object, pack them into a structure, and then recreate everything.
Still, if that's the only way...

Thanks again,

Phil

> >> But how can I go from a Font to a corresponding IFont?
> >
> > See: OleCreateFontIndirect

http://msdn.microsoft.com/library/en-us/com/html/9ab384d6-fc21-4152-a0cf-744948f
2f72c.asp


> For an example see here:

http://www.experts-exchange.com/Programming/Programming_Languages/MFC/Q_20265861.html

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.