Topic: Style??

When I change the Background from the Style in the menu, all the panels and colors that I have used in my program changes in the background color. Is there a way to keep them in the colors that I have used ?

Re: Style??

If I understand the style mechanism correctly, then the answer is "no". But I solved this problem in a different way: I placed the TShape component on the form, and set the color I needed through the Brush.Color and Pen.Color properties.

Визуальное программирование: блог и телеграм-канал.

3 (edited by v_pozidis 2022-07-24 07:31:21)

Re: Style??

Could you please send an axample?? I do not understand the TShape.
Thank you in advance

Re: Style??

procedure Grid_AddFrame( AGrid: TdbStringGridEx; );
// add frame for table view
// as it turned out, if you just change the Border property, then this causes an unpleasant flicker,
// from which even double buffering does not save; so add a frame shape
var
  tmpShape: TShape;
begin
  // create a frame
  tmpShape := TShape.Create(TComponent(AGrid).Owner);
  // name consists of class prefix, personal name, and table view name
  tmpShape.Name := T_SHAPE+GRID_FRAME_NAME+'_'+DeleteClassName(AGrid.Name);
  tmpShape.Parent := AGrid.Parent;
  tmpShape.Top := AGrid.Top;
  tmpShape.Left := AGrid.Left;
  tmpShape.Width := AGrid.Width;
  tmpShape.Height := AGrid.Height;
  tmpShape.Shape := stRectangle;
  // set border color
  tmpShape.Pen.Color := AGrid.Font.Color;
  tmpShape.Pen.Width := GRID_FRAME_WIDTH;
  // set shape color
  tmpShape.Brush.Color := AGrid.Font.Color;
  tmpShape.Anchors := akTop+akLeft+akBottom+akRight;
  // adjust the size and appearance of the table view
  AGrid.Left := AGrid.Left + GRID_FRAME_WIDTH;
  AGrid.Top := AGrid.Top + GRID_FRAME_WIDTH;
  AGrid.Width := AGrid.Width - 2*GRID_FRAME_WIDTH;
  AGrid.Height := AGrid.Height - 2*GRID_FRAME_WIDTH;
  AGrid.BorderStyle := bsNone;
end;
Визуальное программирование: блог и телеграм-канал.

5 (edited by hichame 2022-07-24 14:36:31)

Re: Style??

hello
try this if you want.
you can customise the script as you want.

procedure desactiver_style(var form:tform);
var
i:integer;
begin
form.styleelements:=0;

for i := 0 to  form.componentCount - 1 do
begin
  if form.Components[i] is  Tdbedit then
  begin
  Tdbedit(form.Components[i]).styleelements:=0;;

  end;

  if (form.Components[i] is  Tpanel)  then
  begin
  Tpanel(form.Components[i]).styleelements:=0;
  end;

  if form.Components[i] is  Tlabel then
  begin
  //Tlabel(form.Components[i]).styleelements:=0;;
  end;
end;


begin
desactiver_style(Form1);
end.

Re: Style??

Thank you all

Re: Style??

Can we set the style using script ? I like to give the options of my clients to change they're themes

Re: Style??

please visit K245's Page

Re: Style??

I have a couple of articles on this topic. The first one that StateOne pointed out talks about changing styles from the application using a script. The following section explains how to add button images to a theme: https://k245.ru/mvdb/effekt-babochki.html

Визуальное программирование: блог и телеграм-канал.

Re: Style??

Hello K245;;;
is there way to connect mvd with sql server like we mvd connected with mysql

Re: Style??

StateOne wrote:

Hello K245;;;
is there way to connect mvd with sql server like we mvd connected with mysql

If you meant MS SQL server, then the answer is here:  http://myvisualdatabase.com/forum/viewtopic.php?id=7098

Визуальное программирование: блог и телеграм-канал.

12 (edited by k245 2022-07-27 08:48:16)

Re: Style??

I ran into the opposite problem: not all components have the StyleElements property available, apparently because of this, when creating a component programmatically, it is impossible to set a style for it. Specifically, it's TdbStringGridEx (Table Grid). It is very strange and sad that by default it is created without style. Does anyone know how to programmatically create stylish tables?


http://myvisualdatabase.com/forum/misc.php?action=pun_attachment&item=8886&download=0

Post's attachments

Attachment icon img-2022-07-27-11-45-52.png 64.35 kb, 57 downloads since 2022-07-27 

Визуальное программирование: блог и телеграм-канал.