Solved

TControlBar problem

Posted on 2001-07-14
4
319 Views
Last Modified: 2010-08-05
TControlBar problem

// Button1 is on Form1 and Panel1 is on ControlBar1
// After clicking Button1 I want that Panel1 has this size and position on ControlBar1
// Top = 100
// Left = 100
// Height = 100
// Width = 100
// whatever ControlBar1 size is.


unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ExtCtrls;

type
  TForm1 = class(TForm)
    ControlBar1: TControlBar;
    Panel1: TPanel;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
Panel1.Top:=100;
Panel1.Left:=100;
Panel1.Height:=100;
Panel1.Width:=100;
end;

end.
0
Comment
Question by:gfdas
  • 2
4 Comments
 
LVL 13

Expert Comment

by:Epsylon
ID: 6281904
Set ControlBar1.AutoSize := true  ?
0
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6281909
Hello

  your code work fine, what's the problem with that?

  just insure that the panel1 autosize property set to false

Mohammed
0
 

Author Comment

by:gfdas
ID: 6281966
When I move Panel1 on ControlBar1 I can just move it left and right not up and down. Can that be enabled ?

So, when I press Button1 for top position of Panel1 to 100 ControlBar1 set it to 2. I whant that that is disabled.

Setting ControlBar1.AutoSize := true is not helping.
0
 
LVL 13

Accepted Solution

by:
Epsylon earned 100 total points
ID: 6281975
If you put another control on the ControlBsr then you can move up an down. It's just the way it is, I guess...
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question