[Migrated content. Thread originally posted on 15 February 2010]
We are using a CheckListBox ActiveX Control which seems to work pretty well.The problem is, we want the font to match the other controls on the screen.
In the VB examples that came with the control they call the windows font dialog box then move the font object to the control. I tried to simulate this using a call to W$FONT with no effect.
The .def looks like this:
*[Class: @_DCheckListBox] Font
* Returns a Font object.
PROPERTY-GET, -512, @Font
RETURNING "Font*", TYPE 9
*[Class: @_DCheckListBox] Font
* Returns a Font object.
PROPERTY-PUT, -512, @Font,
"Font* (Property_Value)", TYPE 9
I have tried this:
77 list-font handle of font.
display CheckListBox
handle in ChkList-handle
line 2 col 5 lines 3 size 22
visible 1
EVENT PROCEDURE IS ChkList-EVENT.
inquire ChkList-handle @Font() in list-font.
* initialize wfont-data.
call "w$font" using WFONT-CHOOSE-FONT, list-font,
wfont-data giving wfont-status.
MODIFY ChkList-handle @Font(list-font).
This is how they do it in VB.net:
' Change the font property of the CheckListBox control
Private Sub btnFont_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles btnFont.Click
FontDialog1.Color = ChkList1.ForeColor
FontDialog1.Font = ChkList1.Font
FontDialog1.ShowDialog()
If FontDialog1.Font.Name <> "" Then
ChkList1.Font = FontDialog1.Font
ChkList1.ForeColor = FontDialog1.Color
End If
End Sub
We do not use Acubench.
Any ideas would be greatly appreciated.
Thanks,
Steve



