Solved

TControlBar problem

Posted on 2001-07-14
7
339 Views
Last Modified: 2010-04-04
TControlBar problem

When I press some Bar of ControlBar1 for moving, how to know what component is in that bar ?
0
Comment
Question by:cvbmn
7 Comments
 
LVL 13

Expert Comment

by:Epsylon
ID: 6282205
Use the TControlBar.OnBandMove event. It has a parameter 'Control' which it the control being moved.
0
 

Author Comment

by:cvbmn
ID: 6282282
// This is code. I am not satisfied with it.
// When I press one of bars, Form1 doesn't show automaticly controls name.
// Thanks.

unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    ControlBar1: TControlBar;
    Panel1: TPanel;
    Panel2: TPanel;
    procedure ControlBar1BandMove(Sender: TObject; Control: TControl;
      var ARect: TRect);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}


procedure TForm1.ControlBar1BandMove(Sender: TObject; Control: TControl;
  var ARect: TRect);
begin
if control = Panel1 then form1.Caption:=panel1.name;
if control = Panel2 then form1.Caption:=panel2.name;
end;

end.
0
 

Expert Comment

by:felonious
ID: 6282301
You may for some reason need to force your form1.caption to update.  try

Form1.Repaint

ofcourse there may be some other problem also :)  I will try your code out and see what happens

-felonious
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

Expert Comment

by:felonious
ID: 6282332
hmmm, i tried the above code and its definately not a repaint problem.  it seems that when you move one control on the ControlBar then other is also moved (even if it doesn't seem to change position).  At the moment I cant think of an easy way around this.

-felonious
0
 

Author Comment

by:cvbmn
ID: 6283016
Can you show me some code. I'll increase points to 200.
0
 

Author Comment

by:cvbmn
ID: 6283062
And also, how to disable band moving ?
0
 
LVL 2

Accepted Solution

by:
vbmn earned 200 total points
ID: 6283978
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    ControlBar1: TControlBar;
    procedure ControlBar1MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.ControlBar1MouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
end;

end.
0

Featured Post

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
drawing animated level bar based on numbers 3 97
Unique identifier on a terminal server (rdp) 4 54
Base1 Encode/Decode 3 77
Firemonkey android show image from resource ? 1 42
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
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…

772 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