1 (edited by v_pozidis 2016-04-19 09:47:31)

Topic: MonthCalendar and other simply questions

Hi all,
is it possible to color the day in the Month Calendar ?

and except pressing the Enabled in a combobox, is there a way to lock it ?
and can I also give color in a line of a TableGrid when the 'criteria'  are true?

Re: MonthCalendar and other simply questions

Hello v_pozidis

Question 1 :
I see no property allowing to color day of Month.
But you can circle the day via a script :
Form1.MonthCalendar1.ShowTodayCircle := True; or Form1.MonthCalendar1.ShowTodayCircle := False;

Question 2 :
No way to lock calendar.

Question 3 :

procedure Form1_GridEmployees_OnChange (Sender: string);
var
   i,c: integer;
   k, q: integer;
begin
     Form1.GridEmployees.Columns[3].Visible := False; // hide column
     c := Form1.GridEmployees.RowCount - 1;
     q := Form1.GridEmployees.Columns.Count - 1;
     for i := 0 to c do
     begin
         if Form1.GridEmployees.Cells[3,i] = 'Yes' then
            for k := 0 to q do Form1.GridEmployees.Cell[k,i].Color := clRed;
         if Form1.GridEmployees.Cells[3,i] = 'No' then
            for k := 0 to q do Form1.GridEmployees.Cell[k,i].Color := clGreen;
     end;
end;

You will have to adapt this code according to your 'criteria'

Does thi help you ?

JB

3 (edited by v_pozidis 2016-04-20 06:13:23)

Re: MonthCalendar and other simply questions

Thank's for your help.

In the second question I meant if there is a way to lock a ComboBox, without using the command Enabled and not the MonthCalendar

Re: MonthCalendar and other simply questions

v_pozidis wrote:

Thank's for your help.

In the second question I meant if there is a way to lock a ComboBox, without using the command Enabled and not the MonthCalendar

You can use small hack, place ComboBox on a Panel, then set property Enabled = False for Panel.

Dmitry.

Re: MonthCalendar and other simply questions

Clever trick
Thank's again.