Can anyone tell me how to simulate a button click event on a spinner.
I have a datagrid that contains a spinner control, unfortunately the standard spinner button does not fit well and I would like to put a standard button on top of it. The problem I have is getting the standard button click event to trigger the spinner control .........
I'm sure that there must be some sort of performclick routine for a view but I can't find it.
Hi Erel , thanks for replying. My intention would be to open up the spinner by clicking a secondary button (not the button that is built into the standard spinner).
Sub Globals
Dim sp As Spinner
End Sub
Sub Activity_Create(FirstTime As Boolean)
sp.Initialize("sp")
sp.AddAll(Array As String("a", "b", "c", "d"))
Activity.AddView(sp, 10dip, 10dip, 200dip, 50dip)
End Sub
Sub Activity_Click
OpenSpinner(sp)
End Sub
Sub OpenSpinner(s As Spinner)
Dim r As Reflector
r.Target = s
r.RunMethod("performClick")
End Sub
Sub Globals
Dim sp As Spinner
End Sub
Sub Activity_Create(FirstTime As Boolean)
sp.Initialize("sp")
sp.AddAll(Array As String("a", "b", "c", "d"))
Activity.AddView(sp, 10dip, 10dip, 200dip, 50dip)
End Sub
Sub Activity_Click
OpenSpinner(sp)
End Sub
Sub OpenSpinner(s As Spinner)
Dim r As Reflector
r.Target = s
r.RunMethod("performClick")
End Sub
I just tried this approach to solve the same problem ... but not with 100% success.
My Spinners are set up using the designer.
The first time I click, the spinner panel opens on the far left of the screen running from top to bottom. Looks like an "automatic" placement and sizing is being imposed on it by the software. If I close it and reopen it, it appears where I planned for it.
Is there a similar approach that can be used to close the spinner all the way back up - both from a "wide open" position, and from a position where the spinner has been opened but not yet clicked to provide the dropdown?
Hi Erel,
Thanks for responding.
The code is buried in a much larger program. I have some more critical problems at this time, so I have decided to leave this item until later - or possibly not go that route, I'm not sure yet.
I'll come back to it with code if I need to find a solution.
I would still like to be able to close the spinner by clicking on a different button - similar to the open method discussed, but to close up the spinner.
No itme selection or default vlue needs to be returned from the spinner. Is there a reflection method to do this?
I just tried this approach to solve the same problem ... but not with 100% success.
My Spinners are set up using the designer.
The first time I click, the spinner panel opens on the far left of the screen running from top to bottom. Looks like an "automatic" placement and sizing is being imposed on it by the software. If I close it and reopen it, it appears where I planned for it.
Is there a similar approach that can be used to close the spinner all the way back up - both from a "wide open" position, and from a position where the spinner has been opened but not yet clicked to provide the dropdown?
I had the same problem! what i did was place the spinner in a new panel and then moved the panel where I wanted to the spinner to open. Its a simple work around for now.