Solved

Underline the first letter

Posted on 2001-06-18
5
339 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

717 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