?
Solved

Changing text style in MSFlexgrid

Posted on 2003-03-27
3
Medium Priority
?
385 Views
Last Modified: 2013-12-26
Hey,
I am using MSFlexGrid to display information taken from a text file.
If the value of that text is X I want to display it in italic, if it isn't I want it to be printed normally.It works for the first value but for no other-even though the value of MSFlexGrid1.CellFontItalic is true for the correct values(I have checked with a print to a textbox)

Any ideas?
The code I am using is below.

For Count = 1 To Count1
            If (Ti(Count).Summary = "Yes") Then
                MSFlexGrid1.CellFontItalic = True
                MSFlexGrid1.TextMatrix(Ti(Count).Line_number, 1) = Ti(Count).Taskname

           
            Else
                MSFlexGrid1.CellFontItalic = False
                MSFlexGrid1.TextMatrix(Ti(Count).Line_number, 1) = Ti(Count).Taskname
            End If
Next Count
0
Comment
Question by:eoinb
[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
3 Comments
 
LVL 3

Expert Comment

by:y2ksw
ID: 8218271
You must point to the cell by Row and Col Properties before setting other Cell Styles.
0
 
LVL 11

Accepted Solution

by:
supunr earned 100 total points
ID: 8221475
For Count = 1 To Count1
           MSFlexGrid1.Row = Ti(Count).Line_number
           MSFlexGrid1.Col = 1
           If (Ti(Count).Summary = "Yes") Then
               MSFlexGrid1.CellFontItalic = True
               MSFlexGrid1.TextMatrix(Ti(Count).Line_number, 1) = Ti(Count).Taskname

           Else
               MSFlexGrid1.CellFontItalic = False
               MSFlexGrid1.TextMatrix(Ti(Count).Line_number, 1) = Ti(Count).Taskname
           End If
Next Count

' Good luck!
0
 

Author Comment

by:eoinb
ID: 8223741
Thanks supunr, it was such a small problem and it has been bugging me for days...but then again they always are ;)

0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

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 …
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
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…
Suggested Courses
Course of the Month8 days, 10 hours left to enroll

765 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