P pdabasic Active Member Licensed User Apr 19, 2010 #1 Hy! I would like to use the calendar control and the "GetControls" function. When I Drop Down The calendar control, it is adding a new control, but it doesn't defined... Why? :sign0085: Here is a sample with my problem: Attachments Calendar.sbp Calendar.sbp 758 bytes · Views: 407
Hy! I would like to use the calendar control and the "GetControls" function. When I Drop Down The calendar control, it is adding a new control, but it doesn't defined... Why? :sign0085: Here is a sample with my problem:
agraham Expert Licensed User Longtime User Apr 19, 2010 #2 BringToFront is a method not a property so you don't assign it, the IDE doesn't mind but the compiler will complain. Calendar(cont(len-1)).BringToFront Note that using BringToFront alters the position of the controls in the array so that a control will not stay at the same index as you are assuming. This is the real reson for the problem you are having. However dropping down the Calendar does indeed seem to add a non-existent control with a blank name to the list of controls.
BringToFront is a method not a property so you don't assign it, the IDE doesn't mind but the compiler will complain. Calendar(cont(len-1)).BringToFront Note that using BringToFront alters the position of the controls in the array so that a control will not stay at the same index as you are assuming. This is the real reson for the problem you are having. However dropping down the Calendar does indeed seem to add a non-existent control with a blank name to the list of controls.
P pdabasic Active Member Licensed User Apr 19, 2010 #3 I know the BringToFront method it was just a fault on my sample! My original app I try to set all control property ".Top=0" but after I use the calendar control the sub doesn't work because it find an 'undeclared object' (or I don't know how can I say it English because my message is in Hungarian) So my Question: How can I use my sub with Calendar Control?
I know the BringToFront method it was just a fault on my sample! My original app I try to set all control property ".Top=0" but after I use the calendar control the sub doesn't work because it find an 'undeclared object' (or I don't know how can I say it English because my message is in Hungarian) So my Question: How can I use my sub with Calendar Control?
agraham Expert Licensed User Longtime User Apr 19, 2010 #4 pdabasic said: How can I use my sub with Calendar Control? Click to expand... I tried to say that you can't. Your Sub assumes that the Calendar is always at the same position in the arrays of control names and this is not so if you use BringToFront. Why not just use Calendar1.BringToFront.
pdabasic said: How can I use my sub with Calendar Control? Click to expand... I tried to say that you can't. Your Sub assumes that the Calendar is always at the same position in the arrays of control names and this is not so if you use BringToFront. Why not just use Calendar1.BringToFront.
P pdabasic Active Member Licensed User Apr 19, 2010 #5 I think we misunderstand eachother Only what I want that my app works after I set the Calendar change value Here is my code what makes the alert after I change the date! How can I reedit it or what I have to put inside of code, to make it without alert! How can I skip the +control in the array? Code: Copy controls()=GetControls(contParent) For i=0 To ArrayLen(controls())-1 controlsPos(i)=Control(controls(i)).Top Next
I think we misunderstand eachother Only what I want that my app works after I set the Calendar change value Here is my code what makes the alert after I change the date! How can I reedit it or what I have to put inside of code, to make it without alert! How can I skip the +control in the array? Code: Copy controls()=GetControls(contParent) For i=0 To ArrayLen(controls())-1 controlsPos(i)=Control(controls(i)).Top Next
agraham Expert Licensed User Longtime User Apr 19, 2010 #6 You could try checking that the control name is not an empty string. Don't assume that the position of a control in the array is always the same. Code: Copy controls()=GetControls(contParent) For i=0 To ArrayLen(controls())-1 If controls(i) <> "" Then controlsPos(i)=Control(controls(i)).Top End If Next
You could try checking that the control name is not an empty string. Don't assume that the position of a control in the array is always the same. Code: Copy controls()=GetControls(contParent) For i=0 To ArrayLen(controls())-1 If controls(i) <> "" Then controlsPos(i)=Control(controls(i)).Top End If Next
P pdabasic Active Member Licensed User Apr 19, 2010 #7 agraham said: You could try checking that the control name is not an empty string. Don't assume that the position of a control in the array is always the same. Code: Copy controls()=GetControls(contParent) For i=0 To ArrayLen(controls())-1 If controls(i) <> "" Then controlsPos(i)=Control(controls(i)).Top End If Next Click to expand... I try it! Thank you Agraham again
agraham said: You could try checking that the control name is not an empty string. Don't assume that the position of a control in the array is always the same. Code: Copy controls()=GetControls(contParent) For i=0 To ArrayLen(controls())-1 If controls(i) <> "" Then controlsPos(i)=Control(controls(i)).Top End If Next Click to expand... I try it! Thank you Agraham again