Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.
SpinButton
If I have a piece of code like the following on the create event of a form, the editline gets a spin button. However, if I close the form and re-open the spin button is not displayed. It's functional but not visible, any ideas?
CtrlId = Win:".START"
Handle = Get_Property(CtrlId, "HANDLE")
rv = Send_Message("MAIN_TACTIC.OLE_SUBCLASS", "OLE.Subclass", Handle, CtrlId)
Convert "." to ";" in CtrlId
Call Set_Property("MAIN_TACTIC.OLE_SUBCLASS", "OLE.SpinButton[":CtrlId:"]", 1)
CtrlId = Win:".START"
Handle = Get_Property(CtrlId, "HANDLE")
rv = Send_Message("MAIN_TACTIC.OLE_SUBCLASS", "OLE.Subclass", Handle, CtrlId)
Convert "." to ";" in CtrlId
Call Set_Property("MAIN_TACTIC.OLE_SUBCLASS", "OLE.SpinButton[":CtrlId:"]", 1)
Comments
Thanks for the quick response.
No in fact on one window I have two spin controls. First time window is opened only one is displayed, the second-time window is displayed none are. The window has same name, I close the window and re-open it with the same code. Other windows that have only one spin control, the first window is opened it displays the second time it is not displayed.
If that's not the issue, then I'll need code. I did a test on my end, and I'm able to get multiple spin controls running, and they all show no matter how many times I run the form.
I am using 4.1.6 RC4 of your control.
In one case the window (with two spin controls) is a stand-alone window, started using Start_Window with a parent of MAIN_TACTIC. The other window (with a single spin control) is a mdi child of MAIN_TACTIC. In both cases, the subclass control is on MAIN_TACTIC not on the window that has the issue.
If this doesn't ring any bells, I'll put together a simple test example.
Sent you an RDK, Test and Test1 forms. Run Test and click on the button, this opens Test1 from. Close Test1. Click on the button again. Now click within the editline that has a spin control.
Thanks for the help.
While it's possible to re-code the Subclass method to just always subclass, it would break SRP FrameWorks. Moreover, when using a global Subclass control, it's good memory management to Unsubclass. There is not much overhead in putting a Subclass control on each form, so that's another way to go if you don't want to Unsubclass manually.
Got it, many thanks.
That doesn't seem to work.
I added the code below to the close event. It appears to work but if on the second time opening the form you hover over the spin control it disappears.
Declare Function Get_Property, Send_Message
CtrlId = @Window:".START"
Handle = Get_Property(CtrlId, "HANDLE")
rv = Send_Message("TEST.OLE_SUBCLASS", "OLE.UnSubclass", Handle, CtrlId)
RETURN 1
Moving the Subclass control to TEST1 fixes the problem.
Do not spend any more time on this, I'll fix it here.
Any ideas, ever seen anything like this?
Thanks for the help, it's appreciated,