Need help formatting text in VB6

I have a bunch of old programs written in QuickBasic using the LOCATE command to format text on the screen. Is there something equivalent in Visual Basic to this command? I'm trying to convert these programs over to VB.


  • i don't think there is a true equivalent in VB since VB forms are a different paradigm and are for use with controls. you may be able to simulate the Locate command by using a flexgrid control, and you may need to set other properties such as the width of columns [.ColWidth]

    'add component [menu project, components]
    'microsoft flexgrid control 6.0
    'after adding the control to the project, add it to your from from the toolbox

    'initialize grid
    With Me.MSFlexGrid1
    'set maximum number of row/columns
    .Rows = 8
    .Cols = 8
    .FixedRows = 0
    .FixedCols = 0
    'hide gridelines
    .GridLines = flexGridNone
    End With

    'put some text in the grid
    With Me.MSFlexGrid1
    'set the row/column and the text value
    .Row = 1
    .Col = 1
    .Text = "R2C1"
    .Row = 4
    .Col = 4
    .Text = "R4C4"
    End With
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion