?
Solved

TControlBar problem

Posted on 2001-07-14
7
Medium Priority
?
353 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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 800 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

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month13 days, 16 hours left to enroll

809 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