?
Solved

Is there any way to have the rows of MSHFlexGrid auto size to word wrap text height?

Posted on 2003-03-21
9
Medium Priority
?
231 Views
Last Modified: 2010-05-01
Trying to find a way of getting the rows in an MSHFlexgrid to autosize to the content of their row which contains long string variables and has the word wrap set to true.
0
Comment
Question by:Fuisseran
[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
9 Comments
 
LVL 18

Expert Comment

by:Sethi
ID: 8180168
No way. Use third party grid controls from www.componentone.com to achieve what you want.
0
 
LVL 2

Expert Comment

by:venkatravi_78
ID: 8180843
Private Sub widtha()
    Dim INTROW As Integer
    Dim INTCOL As Integer
   Dim aryWidths() As Double
   ReDim aryWidths(MSHFlexGrid1.Cols - 1)
   For INTROW = 0 To MSHFlexGrid1.Rows - 1
       For INTCOL = 0 To MSHFlexGrid1.Cols - 1
           If Form1.TextWidth(MSHFlexGrid1.TextMatrix(INTROW, INTCOL)) > aryWidths(INTCOL) Then
               aryWidths(INTCOL) = Form1.TextWidth(MSHFlexGrid1.TextMatrix(INTROW, INTCOL))
           End If
       Next
   Next
   For INTCOL = 0 To MSHFlexGrid1.Cols - 1
       MSHFlexGrid1.ColWidth(INTCOL) = aryWidths(INTCOL) + 250
   Next
End Sub
call this procedure where ever u want to
0
 

Author Comment

by:Fuisseran
ID: 8181027
Sorry about this I acctually solved the problem myself, for anyone else that needs it here is how I solved it.

I first made a richtextbox on the form and set it's visibility to false then use the folloing code

(i) is the current row which is beign sized
(WrapCalc) is the richtextbox on the form

With FlexGrid
  .TextMatrix(i, 5) = RepairsRS.Fields("RepairState")
  WrapCalc.Text = .TextMatrix(i, 4)
  l = WrapCalc.GetLineFromChar(WrapCalc.Find(Right(.TextMatrix(i, 4), 2), Len(WrapCalc.Text) - 3)) + 1
  If l > 1 Then .RowHeight(i) = 210 * l Else .RowHeight(i) = 240
End With

Thanks for the responses though
0
Technology Partners: 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!

 
LVL 18

Expert Comment

by:Sethi
ID: 8186797
Good way. I appreciate this approach ;-). Just put a Delete this question request in Community Support so that you get your points back.
0
 

Author Comment

by:Fuisseran
ID: 8189374
Does Any one know how to Delete Or Close this question I try to edti it and it says this question can no longer be edited or deleted
0
 
LVL 18

Expert Comment

by:Sethi
ID: 8190113
There is a Community Support link on the left side. Post a question for 0 points there asking the moderator to delete this question and refund your points.
0
 

Expert Comment

by:CleanupPing
ID: 8531888
Hi Fuisseran,
This old question (QID 20558495) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
0
 
LVL 6

Expert Comment

by:GPrentice00
ID: 8957434
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

-->PAQ - with points refunded

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

GPrentice00
EE Cleanup Volunteer
0
 

Accepted Solution

by:
YensidMod earned 0 total points
ID: 9024784
Question is PAQ'd and points refunded.

YensidMod
Community Support Moderator @Experts Exchange
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
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…
Suggested Courses

764 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