Solved

Underline the first letter

Posted on 2001-06-18
5
331 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

758 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

23 Experts available now in Live!

Get 1:1 Help Now