latruffe Bdovore | Bah, plus la peine de chercher, j'ai trouvé.
Pour ceux que ça interesse, voila un exemple de code :
CreateControl, CreateReportControl Methods Example
The following example first creates a new form based on an Orders table. It then uses the CreateControl method to create a text box control and an attached label control on the form.
Code :
- Sub NewControls()
- Dim frm As Form
- Dim ctlLabel As Control, ctlText As Control
- Dim intDataX As Integer, intDataY As Integer
- Dim intLabelX As Integer, intLabelY As Integer
- ' Create new form with Orders table as its record source.
- Set frm = CreateForm
- frm.RecordSource = "Orders"
- ' Set positioning values for new controls.
- intLabelX = 100
- intLabelY = 100
- intDataX = 1000
- intDataY = 100
- ' Create unbound default-size text box in detail section.
- Set ctlText = CreateControl(frm.Name, acTextBox, , "", "", _
- intDataX, intDataY)
- ' Create child label control for text box.
- Set ctlLabel = CreateControl(frm.Name, acLabel, , _
- ctlText.Name, "NewLabel", intLabelX, intLabelY)
- ' Restore form.
- DoCmd.Restore
- End Sub
|
---------------
« Lorsque le bûcheron pénétra dans la forêt avec sa hache, les arbres se dirent : ne nous inquiétons pas, le manche est des nôtres. » | Gérez votre collection de BD en ligne !
|