Recent

Author Topic: [solve] tvPlanit - how to preselect a ressource?  (Read 303 times)

Nicole

  • Hero Member
  • *****
  • Posts: 731
[solve] tvPlanit - how to preselect a ressource?
« on: February 04, 2023, 10:40:58 am »
In my tvPlanit calender are 2 ressources.
On form1.create I want to be selected the one, which is NOT.

I tried to change this by
TvPlanItFrame.VpResourceCombo1.ItemIndex:=1;

with no effect.

How to do it?
Thanks.
« Last Edit: February 04, 2023, 05:29:07 pm by Nicole »

wp

  • Hero Member
  • *****
  • Posts: 10628
Re: tvPlanit - how to preselect a ressource?
« Reply #1 on: February 04, 2023, 11:54:40 am »
In all my test programs I have these lines to pre-select a given resource:

Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormCreate(Sender: TObject);
  2. begin
  3.   if VpIniDatastore1.Resources.Count > 0 then
  4.     VpIniDatastore1.Resource := VpIniDatastore1.Resources.Items[0];
  5. end;

Nicole

  • Hero Member
  • *****
  • Posts: 731
Re: [solve] tvPlanit - how to preselect a ressource?
« Reply #2 on: February 04, 2023, 05:31:04 pm »
Thank you so much. This works.
And this without the vague bad feeling of my own solution, what would happen, if the datastore is empty.

 

TinyPortal © 2005-2018