Windows 11 24H2 (No windows-11 to select when adding a new topic)
64-Bit LO.
I use following code:
function Form_AfterRecordChange(Event as object)
Dim oForm as object
dim oControl as object
dim oController as object
dim oControlView as object
oForm = ThisComponent.DrawPage.Forms.getByIndex(0)
oController = ThisComponent.CurrentController
if oForm.GetPropertyValue("IsNew") = True then
OControl = oForm.GetByName("Date") ' bound Date control
else
OControl = oForm.GetByName("buNew") ' button
endif
oControl.Enabled = True
oControlView = oController.GetControl(oControl)
oControlView.SetFocus
I have used MRI to confirm that the control IS Enabled.
This worked in LO 7.6.4.1.