VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Display vertical Text in a MSFlexGrid

Martin Koenig  (1 Submission)   Custom Controls/Forms/Menus   Visual Basic 3.0   Unknown Difficulty   Wed 3rd February 2021

With this code you are able to display vertical Text in a Flexgrid. This is
very helpfull, when you need to display a column which only has a YES/NO
Value and would waste to much horizontal Column Space to display the Column
Header

Assumes
1.Start a simple Project 2.Add the Microsoft Flex Grid component to the Project 3.Add a Picture to the Project, set the Index=0, Visible=FALSE and AutoRedraw=TRUE 4.Copy the API Code and but it in a Module 5.Copy the normale Code in to the Form Code Module

Side Effects
I am not aware of any Side Effects, I am using this code in several Application. But be aware that you set the AutoRedraw Property of the PictureBox TRUE, otherwise you wont see anything. Be also carefull with the Picture Alignement settings of the certain MSFlexGrid1.CellPictureAlignement.

API Declarations
Option Explicit
'****************
' API Declaration
'****************
Public Declare Function CreateFontIndirect Lib "gdi32" Alias
"CreateFontIndirectA" (lpLogFont As LOGFONT) As Long
Public Declare Function SelectObject Lib "gdi32" (ByVal hDC As Long, ByVal
hObject As Long) As Long
Public Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As
Long
'**********************
' API Const Declaration
'**********************
Public Const LF_FACESIZE = 32
Public Const ANTIALIASED_QUALITY = 4
Public Const FW_NORMAL = 400
Public Const FW_BOLD = 700
Public Const DEFAULT_CHARSET = 1
Public Const OUT_TT_PRECIS = 4
Public Const VARIABLE_PITCH = 2
'*********************
' API Type Declaration
'*********************
Public Type LOGFONT
lfHeight As Long
lfWidth As Long
lfEscapement As Long
lfOrientation As Long
lfWeight As Long
lfItalic As Byte
lfUnderline As Byte
lfStrikeOut As Byte
lfCharSet As Byte
lfOutPrecision As Byte
lfClipPrecision As Byte
lfQuality As Byte
lfPitchAndFamily As Byte
lfFaceName As String * LF_FACESIZE
End Type

Rate Display vertical Text in a MSFlexGrid (3(3 Vote))
Display vertical Text in a MSFlexGrid.bas

Display vertical Text in a MSFlexGrid Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters