Solved

Underline the first letter

Posted on 2001-06-18
5
332 Views
Last Modified: 2010-05-02
I have a flexgrid.
And i want to display a word in the flex that only the first letter will have an underline.
Or to mark the first letter with different color.

I will thank if anyone can have a solution for me.
0
Comment
Question by:ariell
5 Comments
 
LVL 43

Expert Comment

by:TimCottee
ID: 6201410
ariell, this is unfortunately not possible with the flexgrid. You do not have much control over individual characters within the flexgrid cells. The following code simulates the underlining of the first character of each cell in a column by setting a cellpicture to contain a single line the approximate width of the first character.

Private Sub Command1_Click()
    With Picture1
        For intRow = 1 To MSFlexGrid1.Rows - 1
            .Width = MSFlexGrid1.ColWidth(1)
            .Height = MSFlexGrid1.RowHeight(intRow) + 50
            .Cls
            .AutoRedraw = True
            MSFlexGrid1.Row = intRow
            MSFlexGrid1.Col = 1
            .BackColor = MSFlexGrid1.BackColor
            .FontSize = MSFlexGrid1.CellFontSize
            .FontName = MSFlexGrid1.CellFontName
            Picture1.Line (5, .ScaleHeight - 2)-(.TextWidth(Left(MSFlexGrid1.TextMatrix(intRow, 1), 1)), .ScaleHeight), vbBlack, BF
            Set MSFlexGrid1.CellPicture = Picture1.Image
        Next
    End With
End Sub

Private Sub Form_Load()
    With MSFlexGrid1
        For intRow = 1 To .Rows - 1
            .TextMatrix(intRow, 1) = "Hello"
            .Col = 1
            .Row = intRow
            .CellFontSize = 5 + intRow
            Me.FontSize = .CellFontSize
            .RowHeight(intRow) = Me.TextHeight(.TextMatrix(intRow, 1))
            .ColWidth(1) = Me.TextWidth(.TextMatrix(intRow, 1))
        Next
    End With
End Sub
0
 
LVL 49

Accepted Solution

by:
DanRollins earned 100 total points
ID: 7136225
Hi ariell,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will suggest to:

    Accept TimCottee's comment(s) as an answer.

ariell, if you think your question was not answered at all or if you need help, you can simply post a new comment here.  Community Support moderators will follow up.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Author Comment

by:ariell
ID: 7136920
It was an old question, i forgot about it.
Thank for your reminder.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7137023
ariell,
Too late now, but in the future, please accept one of the comments made by one of the Experts who helped you (not me). Thanks! --Dan
0
 
LVL 6

Expert Comment

by:Mindphaser
ID: 7138233
TimCottee

I will post a separate question for you in his TA.

** Mindphaser - Community Support Moderator **
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now