|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Column Width for MSFlexGridI develop the application which contains MSFlexGrid to display data. When I
try to fill the grid with the text data, I want to adjust the column width so that the width is adjusted to the maximum pixel width of the column text data. I have a function to measure the pixel width of the string data, however, I found that the parameter of the Set_ColWidth() function in MSFlexGrid is not in pixel unit. How can I convert the pixel unit to the unit which is using in MSFlexGrid? "Steven" <a@a.com> schrieb: MSFlexGrid uses twips, but .NET uses pixels. You can use the code below to >I develop the application which contains MSFlexGrid to display data. When I >try to fill the grid with the text data, I want to adjust the column width >so that the width is adjusted to the maximum pixel width of the column text >data. I have a function to measure the pixel width of the string data, >however, I found that the parameter of the Set_ColWidth() function in >MSFlexGrid is not in pixel unit. How can I convert the pixel unit to the >unit which is using in MSFlexGrid? convert pixels to twips: \\\ Private m_TwipsPerPixelX As Integer Private m_TwipsPerPixelY As Integer .... Using g As Graphics = Me.CreateGraphics() m_TwipsPerPixelX = 1440 / g.DpiX m_TwipsPerPixelY = 1440 / g.DpiY End Using .... Me.MSFlexGrid1.ColWidth = 100 * m_TwipsPerPixelX /// -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/>
MsgBox("test") no msg box?
How do I schedule events for execution ? How to check datatable.select Type 'OleDbConnection' no define Getting the hWnd of an IE window from an NT service Variable that holds the record count of a result set? Question on Dataset navigation vb.net Generate all possible maches from a regular expression. How to know if Windows firewall is on or off? Project Notes and Journals |
|||||||||||||||||||||||