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

    Ascii Character & Tabstrip control

    Does anyone have a tabstrip example to show how to build a tab control in a step-by-step example?
    I'm stuffed if i can get these to work.

    Also does anyone know why when i put in the ascii character 153 (trademark symbol) all i get is a thick vertical line? as a matter of fact none of the characters between 150 to 159 work.
    I can get the copyright symbol (169) and the registered symbol (174) to work ok but not the trademark one.
    I'm using them all like this Chr(169)

    Can anyone help?



  2. #2
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167

    Re: Ascii Character & Tabstrip control

    Try looking at Microsoft Tabbed Dialog Control instead of Tab Strip. I could not get Tab Strip to work either before. Where are you trying to put the Chr(153)? It does not work if you put it on a command button but should work fine if you actually put it on a text control.

    HTH,
    -Cool Bizs

    Good Luck,
    -Cool Bizs

  3. #3
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: Ascii Character & Tabstrip control

    The interpretation of the chr$(xx) values depends on the font you are using and how the control you are placing the character on interprets it. Chr$(153) may not be a trademark symbol in the Font you are using.

    John G

  4. #4
    Join Date
    May 2001
    Location
    New Jersey, USA
    Posts
    47

    Re: Ascii Character & Tabstrip control


    private FontIndx as Integer
    ' Paste this into the code section, then...
    ' Make a TextBox named txtChars with MultiLine set to true and
    ' one Command Button named cmdStep. make the TextBox 3255 x 3975 twips,
    ' to be sure you can see all of it's contents
    ' Click cmdStep to go through all of the fonts on your machine to
    ' see wich one has the special characters you need.
    ' You may need to distribute the font that has your special characters
    ' along with your application.

    private Sub cmdStep_Click()

    Dim j as Integer

    ' wrap the count back to 1
    If FontIndx > Screen.FontCount - 1 then
    FontIndx = 0
    End If

    txtChars.Text = ""
    txtChars.Font = Screen.Fonts(FontIndx)
    txtChars.FontBold = false
    txtChars.Text = Screen.Fonts(FontIndx) & " # " & FontIndx & " of " & Screen.FontCount - 1 & vbCrLf

    ' change this number range for various special characters
    for j = 150 to 160
    txtChars.Text = txtChars.Text & Chr(j) & " = " & j & vbCrLf
    next j

    ' Or hard code known values
    txtChars.Text = txtChars.Text & Chr(169) & " Copyright = 169" & vbCrLf
    txtChars.Text = txtChars.Text & Chr(174) & " Registered = 174" & vbCrLf

    FontIndx = FontIndx + 1

    End Sub

    private Sub Form_Load()
    FontIndx = 0
    End Sub






  5. #5
    Join Date
    Sep 2000
    Posts
    23

    Re: Ascii Character & Tabstrip control

    I'll reply to my message instead of each message:
    Thanks for the replys.

    Thanks for that bit of code Isaacson, i'll look into it.
    Do you three mean the font i'm currently using in VB6 or in Windows 98SE?

    John G & CoolBizs: (how you going CoolBizs, thought i'd ask someone else for a change, your proberly sick of me asking questions)
    The character is being placed in a label in the about box. E.G "[name] is an Registered " & Chr(174) & " Trademark" & Chr(153) & " of [whoever]"

    Well.. i'm just doing it quickly so it's something like that.

    CoolBizs:
    Christ! no wonder i can't get the stupid Tabstrip to work if YOU'VE had trouble with it. The Tab control one you speak of is that the SST Tab control, i've used that and it looks ugly as sin, simple to use but ugly as hell.
    I have some code for a tabstrip (it works) but i can't marry it to into another form where it is needed.
    I'll do some more searching and see if i can find something else.

    Thank you for your help guys.



  6. #6
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: Ascii Character & Tabstrip control

    Change your Labels Font to "News Gothic MT".
    Chr$(153) = tm
    Chr$(169) = (c)
    chr$(174) = (r)

    Label1.FontName = "News Gothic MT"
    Label1.Caption = "Trademark" & Chr$(153) & " Registered" & Chr$(174) & "CopyWrite" & Chr$(169)




    John G

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