DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3

Hybrid View

  1. #1
    Peter Guest

    How to select a FONT file in FILEOPEN Common Dialog


    Hi,

    I have a delicate problem that seems to be hard to solve...

    I need to get a FILENAME from the FileOpen Common Dialog when selecting a
    font from Windows fonts directory e.g. c:\Windows\Fonts\ or c:\WinNT\Fonts.
    The FileOpen common dialog refuses to return any filename when selecting
    a file/font in this special directory.

    Normally when selecting a file in the FileOpen Common Dialog’s File listbox
    the filename is copied to the Filename textbox beneath. By use of sub-classing
    I have been able to catch notifications related to the selection made in
    the listbox. When selecting the Windows Fonts directory and selecting a Font
    file (shown by friendly name) all notification stops. The FileOpen common
    dialog refuses to return any filename or any useful notification.

    Thanks,
    Peter


  2. #2
    Ian King Guest

    Re: How to select a FONT file in FILEOPEN Common Dialog

    Hi Peter

    The reason why you don't get any return from the FileOpen dialog is because
    you're accessing a shell folder and therefore the names you see aren't the
    actual file names.

    What you should be using is the ChooseFont dialog instead.

    regards

    Ian

    ** invalid email address, change dk to denmark

    homepage http://www.kingsoft-denmark.com/


    Peter <peter.jonsson@intermec.com> wrote in message
    news:3940be51$1@news.devx.com...
    >
    > Hi,
    >
    > I have a delicate problem that seems to be hard to solve...
    >
    > I need to get a FILENAME from the FileOpen Common Dialog when selecting a
    > font from Windows fonts directory e.g. c:\Windows\Fonts\ or

    c:\WinNT\Fonts.
    > The FileOpen common dialog refuses to return any filename when selecting
    > a file/font in this special directory.
    >
    > Normally when selecting a file in the FileOpen Common Dialog's File

    listbox
    > the filename is copied to the Filename textbox beneath. By use of

    sub-classing
    > I have been able to catch notifications related to the selection made in
    > the listbox. When selecting the Windows Fonts directory and selecting a

    Font
    > file (shown by friendly name) all notification stops. The FileOpen common
    > dialog refuses to return any filename or any useful notification.
    >
    > Thanks,
    > Peter
    >




  3. #3
    Peter Guest

    Re: How to select a FONT file in FILEOPEN Common Dialog


    Hi Ian,

    Thanks for your response. I actually want to get the name of the file holding
    the font and that is the reason trying to use a FileOpen dialog. I wish to
    get the file name "ARIBLK.TTF" in return when selecting the "Arial Black".
    I appreciate your help if you have any useful information helping me out
    on this one.

    Regards
    Peter

    "Ian King" <advice@kingsoft-dk.com> wrote:
    >Hi Peter
    >
    >The reason why you don't get any return from the FileOpen dialog is because
    >you're accessing a shell folder and therefore the names you see aren't the
    >actual file names.
    >
    >What you should be using is the ChooseFont dialog instead.
    >
    >regards
    >
    >Ian
    >
    >** invalid email address, change dk to denmark
    >
    >homepage http://www.kingsoft-denmark.com/
    >
    >
    >Peter <peter.jonsson@intermec.com> wrote in message
    >news:3940be51$1@news.devx.com...
    >>
    >> Hi,
    >>
    >> I have a delicate problem that seems to be hard to solve...
    >>
    >> I need to get a FILENAME from the FileOpen Common Dialog when selecting

    a
    >> font from Windows fonts directory e.g. c:\Windows\Fonts\ or

    >c:\WinNT\Fonts.
    >> The FileOpen common dialog refuses to return any filename when selecting
    >> a file/font in this special directory.
    >>
    >> Normally when selecting a file in the FileOpen Common Dialog's File

    >listbox
    >> the filename is copied to the Filename textbox beneath. By use of

    >sub-classing
    >> I have been able to catch notifications related to the selection made

    in
    >> the listbox. When selecting the Windows Fonts directory and selecting

    a
    >Font
    >> file (shown by friendly name) all notification stops. The FileOpen common
    >> dialog refuses to return any filename or any useful notification.
    >>
    >> Thanks,
    >> Peter
    >>

    >
    >



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links