Thank you for responding, Tony.
I am using VB6. The BorderStyle is currently set to 2-Sizable (though I have tried other settings). When I vlax-invoke the component from vlisp the form is on top of the acad window. I have tried the code in the load, initialize and activate event - no difference. When I stretch the form the buttons are all in the correct position - though in the final version I would like to make the border style fixed.
Here is the current code:
frmCmd with two buttons, cmdX (index 0) and cmdCancel.
code in form:
Private Sub cmdCancel_Click
Me.Hide
Unload Me
End Sub
Private Sub cmdX_Click(Index As Integer)
varReturn = cmdX(Index).Caption
Me.Hide
Unload Me
End Sub
Private Sub Form_Load
Dim lst, pair As Variant
Dim i, h As Integer
lst = Split(varData, vbVerticalTab)
pair = Split(lst(0), vbCr)
h = frmCmd.Height + (240 * (UBound(lst) - 1))
cmdX(0).Caption = pair(0)
cmdX(0).ToolTipText = pair(1)
For i = 1 To UBound(lst) - 1
pair = Split(lst(i), vbCr)
Load cmdX(i)
cmdX(i).Caption = pair(0)
cmdX(i).ToolTipText = pair(1)
cmdX(i).Top = cmdX(i - 1).Top + 480
cmdX(i).Visible = True
Next i
frmCmd.Move frmCmd.Left, frmCmd.Top, frmCmd.Width, h
'frmCmd.Height = h
cmdCancel.Top = frmCmd.Height - 840
End Sub
code in class module ui_functions:
Public Function cmd_form(vdata As Variant) As Variant
Dim frm As frmCmd
varData = vdata
Set frm = New frmCmd
frm.Show vbModal
cmd_form = varReturn
Unload frm
Set frm = Nothing
End Function
Public varSet, varData, varReturn As Variant in base module
In lisp I reformat an assoc list with the command name and tool tip text into a string divided by vbVerticalTab and vbCr to pass as an argument to the function cmd_form.
Peter