CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2001
    Posts
    2

    How to change the notepad Font from VB

    Hi,
    I want to print a string in notepad. If i print the same string in Lower or Upper cases it should occupy same width in both cases. In that case i want to change the font of notepad How..?
    Is there any other porcedure to get the same result ..?
    Pls help me.



  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: How to change the notepad Font from VB

    Notepad fonts are stored in notepad, not in text file. Notepad will remember
    last used fonts. To change it before opening notepad, you should change
    vauels in registry (it will not affect already opened instances of notepad, and first instance closed will write its values to registry, thus affecting next opening one!).
    Ie: on NT machine:
    HKEY_CURRENT_USER\Software\Microsoft\notepad
    key = lfFaceName
    value = "your font name"
    ie:
    lfFaceName="Courier New"

    dimension:
    key = iPointSize
    value= points in exadecimal or decimal

    Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
    and all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

    The Rater
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  3. #3
    Join Date
    Jun 2001
    Location
    Sri Lanka
    Posts
    272

    Re: How to change the notepad Font from VB

    Just a hint:
    U can get the handle of Note Pad
    Then get the Handle of Font Menu.
    Then Adopt a technique of invoking that and get ur work done
    (I have not tried!!!)
    Good Luck
    Srinika

    If u don't know how to Rate an answer, then Rate my answer to learn, If u know, then practice it

  4. #4
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Fonts And Registry

    Here some hints on how to set registry values
    http://codeguru.com/cgi-bin/bbs/wt/s...age=&view=&sb=

    Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
    and all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

    The Rater
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured