calender control option show/open ?

mike2ppc

Member
Licensed User
Longtime User
Hallo to All,

does anyone know if it is possible to open the calender control
by any option like show or open ?

I want to realize by click on a textbox or a button to open the
calender view.

Michael
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
You can send the 'click' message to the control with Hardware.SendMessageToControl:
Pressing Button1 will show the calendar or hide it if it is already opened.
B4X:
Sub Globals
    'Declare the global variables here.

End Sub

Sub App_Start
    Form1.Show
    hardware.New1 'Hardware object
End Sub

Sub Button1_Click
    hardware.SendMessageToControl("Calendar1",513,0,0) 'Change Calendar1 to your calendar name.
    hardware.SendMessageToControl("Calendar1",514,0,0) 'Change Calendar1 to your calendar name.
End Sub
 

mike2ppc

Member
Licensed User
Longtime User
Erel,

thanks, first step of showing calendar control works fine, but the event never
work for example

sub calendar1_ValueChanged
TextBox1.text=calendar1.value
end sub

do I have to work in this case also with hardware libary ?

From where I can get a list of all possible parameters for the calendar control working with sendmessagetocontrol ?

Michael
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
Erel,

thanks, first step of showing calendar control works fine, but the event never
work for example

sub calendar1_ValueChanged
TextBox1.text=calendar1.value
end sub

do I have to work in this case also with hardware libary ?

From where I can get a list of all possible parameters for the calendar control working with sendmessagetocontrol ?

Michael

I'm not sure I understand the problem.
This event will be raised when the user changes the date value.
 

mike2ppc

Member
Licensed User
Longtime User
Hi Erel,

attached you find a small example maybe helps for better
understanding of my problem.

In this example the control calendar1 is visible=false, when you click on the button1 control beside the
TextBox1 Control the Calender1 control opens and now I want to change the date and the result
should be display in the TextBox1 control. But no reaction after clicking in the calender control
on a different date to today the calender1 control only close but not move throu the event value_changes.

Did I something wrong ?

Thanks

Michael
 

Attachments

  • test_calender_send_click.sbp
    859 bytes · Views: 161
Last edited:

mike2ppc

Member
Licensed User
Longtime User
Hi Erel,

now I'm developing on Vista and I got the error message
"System.Security.Permissions.SecurityPermission"
by using

hw1.SendMessageToControl("Calendar1",513,0,0)
hw1.SendMessageToControl("Calendar1",514,0,0)

Do you know about this problem and maybe have a solution for me ?

Best Regards

Michael
 

mike2ppc

Member
Licensed User
Longtime User
it happens in the basic4ppc developing UI desktop and when I start the compiled executeable file then I got message shown in attached printscreen
Translation:
DE = Fehler bei der Anforderung des Berechtigungstyps
EN = Error by request the authority types
When I do right click on executable file and execute as admin it popup with same error message !
 

Attachments

  • printscreen.pdf
    13.2 KB · Views: 187

mike2ppc

Member
Licensed User
Longtime User
Problem solved, it was a authority situation, source folder
located on a seperate drive on physical maschine and I have tied to work with a mapped root from virtual maschine running on physical maschine where source folder. Now I have copied complete source folder directly on the virtual maschine and all works fine.
 
Top