Hi, is it possible to use standard MS controls in xojo desktop apps (complied for windows, of course) ?
Can I import a VB (datepicker) control, for example ?
Thanks!
Hi, is it possible to use standard MS controls in xojo desktop apps (complied for windows, of course) ?
Can I import a VB (datepicker) control, for example ?
Thanks!
Not all controls will work. In the specific case of the date picker, there are several alternatives develoiped in Xojo for Xojo, that you may well find better than the old VB control. Scan the forum and you will find them all
can’t edit… Here is one that is quite popular on the forum. And, it is free!
I have not had much luck with several of the controls ( probably more because I don’t know what I am doing ), but the dtpicker seems to work. Add the dtpicker activex component to your project and play about. This works to change from date to time for example:
Dim v as variant
v=2
DTPicker1.Format=v
Hey Peter… Tried your suggestion… but I couldn’t set an initial value without gettina a COM exception “failed on value”…
How do you set an inital time or date for the control ?
Sorry, I don’t know. I’ll play around when I get some time.
Here is a suggestion: create a date variable. Assign a date to it. Then use the SQLDate property of the date variable to assign a date to the VB control (I forget the property of the VB control that you need to feed, it has been a long time). If I recall correctly, assigning a date string in the format generated by the SQLDate property is automatically converted in a correct date in the VB control.
I would still recommend a Xojo control instead. If you don’t like the one suggested above, lookup Einhugur’s date picker control. It is also highly regarded, but not free. There are others. Graffitti Suite includes a date picker also. There is plenty of choice, and all these are designed to work with Xojo apps.
One last point. if you distribute the Xojo app with the old VB control, you will have to find a way to register the ActiveX. I suppose that you are familiar with installers that can do this.
I gave up… I am going for a native option… thanks!
Nevertheless…
I haven’t done too much but:
Don’t add it as an Activex control to the project, rather add an OleContainer ( say Ole1 ) and add the DTPicker to that by choosing it.
Then
Dim v as variant
v="10/31/97"
ole1.Content.Value=v
[quote=257881:@Peter Job]Nevertheless…
I haven’t done too much but:
Don’t add it as an Activex control to the project, rather add an OleContainer ( say Ole1 ) and add the DTPicker to that by choosing it.
Then
Dim v as variant
v="10/31/97"
ole1.Content.Value=v
[/quote]
That’s works great !
In DTPicker1 open event :
Sub Open()
Dim v as variant
v="10/31/97"
DTPicker1.Content.Value=v
End Sub
Thanks