Solved

Drag and Drop between ToolButtons in a ToolBar

Posted on 2004-09-24
5
274 Views
Last Modified: 2010-04-05
Hi,

Can somebody quickly provide me with some sample code to implement drag and drop between ToolButtons in a ToolBar. I am feeling lazy to find it out.

regards,
Partha
0
Comment
Question by:perthg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 12

Expert Comment

by:esoftbg
ID: 12140776
What do you want to be dragged between these two buttons ? (May be you need to interchange the captions each other ?)
0
 
LVL 22

Expert Comment

by:Ferruccio Accalai
ID: 12140828
Or do you want just to drag them between themself? Waiting for input addition.

BTW Partha, i've found that you've a few questions still open, and in one of these i've provided a full working solution, but it seems that you've abandoned it.

What's going on? If you need more help in your questions just ask for it...


04/03/2004 http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20942169.html
06/27/2004 http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_21039634.html
07/22/2004 http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_21067382.html
08/18/2004 http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_21098533.html
08/25/2004 http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_21106231.html
08/25/2004 http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_21106232.html

F68 ;-)
0
 
LVL 12

Expert Comment

by:Ivanov_G
ID: 12140852
you can drag them ... at design-time :)))
0
 

Author Comment

by:perthg
ID: 12141358
I want to drag and drop between ToolButtons to interchange their positions.

F68, the questions are open because I did'nt find an acceptable reply, however I am sorry that I missed the one you replied because I solved the problem myself. But you deserve the points, Thanks a lot.

Partha
0
 
LVL 12

Accepted Solution

by:
esoftbg earned 200 total points
ID: 12141732
download a working example from:
page:        http://www.geocities.com/esoftbg/
  link:        Q_21143474.zip

//........

procedure TForm1.ToolButton1DragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);
begin
  if (Source is TToolButton) then
    Accept :=  ((Source as TToolButton)<>Sender);
end;

procedure TForm1.ToolButton1DragDrop(Sender, Source: TObject; X, Y: Integer);
var
  I:      Integer;
begin
  if (Sender is TToolButton) then
  begin
    I := (Sender as TToolButton).Left;
    if (Source is TToolButton) then
    begin
      (Sender as TToolButton).Left := (Source as TToolButton).Left + 1;
      (Source as TToolButton).Left := I + 1;
    end;
  end;
end;
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

730 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