Results 1 to 18 of 18

Thread: ASCII Special Characters

Threaded View

  1. #11
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: ASCII Special Characters

    Regarding "selected font" ... that was a waky way of saying it ...
    What I meant was that you will need to set some font to a command button first and then select that "special" character for its caption.
    However, setting that special char as one of the characters in a textbox could be problematic unless button and textbox both have the same fonts.
    Using RichTextBox on the other hand will allow you to set any available font to a single character (SelFont is the property I believe) so the proper char will be displayed. Also, since fonts are usually tricky to work with you might need to (but not necessary) distribute font(s) utilized in your project.

    Here is a quote from MSDN that explains resource files in a nutshell:
    Working with Resource Files


    A resource file allows you to collect all of the version-specific text and bitmaps for an application in one place. This can include icons, screen text, and other material that may change between localized versions or between revisions or specific configurations.

    Adding Resources to a Project
    You can create a resource file using the Resource Editor add-in. The compiled resource file will have a .res file name extension. Each project can contain only one resource file.

    The actual file consists of a series of individual strings, bitmaps, or other items, each of which has a unique identifier. The identifier is either a Long or a String, depending on the type of data represented by the resource. Strings, for example, have a Long identifier, while bitmaps have a Long or String identifier. To retrieve resources in your code, learn the identifier for each resource. The function parameters referring to the resources can use the Variant data type.

    To add a new resource file to your project

    Choose Resource Editor from the Tools menu. An empty resource file will be opened in the Resource Editor window.
    Note The Resource Editor add-in must be installed. For information on installing add-ins, see "Using Wizards and Add-Ins" in "Managing Projects".

    Select the Save button on the Resource Editor toolbar to save the resource file. The file will be added to the Project Explorer under the Related Documents section.
    To add an existing resource file to your project

    Choose Add New Resource File from the Project menu. Any existing resource file in your project will be replaced.
    Caution If you make any modifications to an existing resource file it could affect other projects that use that resource file. Make sure that you save the file under a new filename.

    Note The Resource Editor add-in must be installed. For information on installing add-ins, see "Using Wizards and Add-Ins" in "Managing Projects."

    For More Information For more information on resource files, see "Using Resource Files for Localization" in "International Issues."

    Note Windows resource files are specific to 16-bit or 32-bit applications. Visual Basic will generate an error message if you try to add a 16-bit resource file to a project.

    Using Resources in Code
    Visual Basic provides three functions for retrieving data from the resource file for use in code.

    Function Description
    LoadResString Returns a text string.
    LoadResPicture Returns a Picture object, such as a bitmap, icon, or cursor.
    LoadResData Returns a Byte array. This is used for .wav files, for example.


    For More Information See the appropriate function topic.
    Last edited by RhinoBull; Jun 21st, 2005 at 04:11 PM.

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