Board index » delphi » DBGrid [D2]; Create method [D2]

DBGrid [D2]; Create method [D2]

Hi all,
I have two questions:
1. Is it possible to make a DBGrid not to show time fields with seconds?
In my application an end user will fill in the time fields in a DBGrid;
if he writes 17:00 and presses <Post>, DBGrid shows 17:00:00. I don't
need seconds! I tried to modify the Picture property of that field while
reconstructuring the Paradox table, but without any result.
2. I've tried to create several SpeedButtons on a Form. I've written a
sample of code...

    procedure TForm1.Create(Sender: TObject);
    var B: TSpeedButton;
    begin
    B:=TSpeedButton.Create(Form1);
    end;

...and no SpeedButton appears on (I think it is created, because
Form1.ComponentCount grows). I tried to set a Name, Height, Visible
properties and so on...
Any ideas. TIA
Wojtek

 

Re:DBGrid [D2]; Create method [D2]


2.  after your b:TSpeedButton.Create(Form1); do:
                     b.parent := Form1;
Quote
Wojtek Pawlowski wrote:
> Hi all,
> I have two questions:
> 1. Is it possible to make a DBGrid not to show time fields with seconds?
> In my application an end user will fill in the time fields in a DBGrid;
> if he writes 17:00 and presses <Post>, DBGrid shows 17:00:00. I don't
> need seconds! I tried to modify the Picture property of that field while
> reconstructuring the Paradox table, but without any result.
> 2. I've tried to create several SpeedButtons on a Form. I've written a
> sample of code...

>     procedure TForm1.Create(Sender: TObject);
>     var B: TSpeedButton;
>     begin
>     B:=TSpeedButton.Create(Form1);
>     end;

> ...and no SpeedButton appears on (I think it is created, because
> Form1.ComponentCount grows). I tried to set a Name, Height, Visible
> properties and so on...
> Any ideas. TIA
> Wojtek

Re:DBGrid [D2]; Create method [D2]


you need set maskdisplay for every  time fields

Wojtek Pawlowski ??? a ???? <35FCB3F6.60462...@sgh.waw.pl> ...

Quote
>Hi all,
>I have two questions:
>1. Is it possible to make a DBGrid not to show time fields with seconds?
>In my application an end user will fill in the time fields in a DBGrid;
>if he writes 17:00 and presses <Post>, DBGrid shows 17:00:00. I don't
>need seconds! I tried to modify the Picture property of that field while
>reconstructuring the Paradox table, but without any result.
>2. I've tried to create several SpeedButtons on a Form. I've written a
>sample of code...

>    procedure TForm1.Create(Sender: TObject);
>    var B: TSpeedButton;
>    begin
>    B:=TSpeedButton.Create(Form1);
>    end;

>...and no SpeedButton appears on (I think it is created, because
>Form1.ComponentCount grows). I tried to set a Name, Height, Visible
>properties and so on...
>Any ideas. TIA
>Wojtek

Other Threads