Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

MDI Taskbar

Posted on 2003-10-28
7
Medium Priority
?
771 Views
Last Modified: 2010-04-16
I have a MDI form. I need a taskbar for the MDI children, like the switchbar in mIRC, which does the same thing. I have searched all over, but i can't find any. I saw some taskbars on www.torry.net/taskbars.htm, but they don't work in DELPHI 7 (the version i have) or they don't have any source code. Could you tell me how to create such taskbar, or make me a component(TTaskBar for example) ?

My e-mail is sandy@alexandrion.ro
0
Comment
Question by:SandyXP
[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
  • 4
7 Comments
 

Author Comment

by:SandyXP
ID: 9635060
I think i could use a ttoolbar or something like that do do this.
0
 

Accepted Solution

by:
jgilm earned 500 total points
ID: 9637175
You could make your own. Put the following in a procedure and call it every time an MDI is created or destroyed (or hidden). This will create buttons for as many MDI windows as are available. You may have to modify this to get them to look how you want them. The event that is assigned to the OnClick brings the window to the foreground. The window number (in the MDIChildren array) is stored in the tag property of the toolbutton, but there are other ways to link the button and the window.

procedure TMainForm.UpdateToolbar;
begin
  for I := Toolbar1.ButtonCount - 1 downto 0 do
      ToolBar1.Buttons[I].Free;

  for I := 0 to MainForm.MDIChildCount - 1 do
  begin
    with TToolButton.Create(toolbar1) do
    try
      AutoSize  := True;
      Grouped   := True;
      Parent    := Toolbar1;
      Tag       := i;
      Caption := MainForm.MDIChildren[i].Caption;
      OnClick   := ToolButtonClick;
    except
      Free;
      raise;
    end;
  end;
end;

procedure TMainForm.ToolButtonClick(Sender: TObject);
begin
  MainForm.MDIChildren[ (Sender as TToolButton).Tag ].BringToFront;
end;

-- jgilm
0
 

Author Comment

by:SandyXP
ID: 9642320
Well, it kindda works..
But there are some major problems:
- How can I place every ToolButton on a new row? (i want the toolbar to be vertical, not horizontal like the windows taskbar)
- I have multiple mdi children but i can only select them by clicking on the first toolbutton, which iterates through the windows, putting them on top one by one. I tested it with 2 windows and when i click the second button nothing happens.

Could you help me?
AND one more thing: where EXACTLY shoud i place the UpdateToolBar procedure?
0
 

Author Comment

by:SandyXP
ID: 9642387
And btw, i need another thing:
Please tell me how to insert images into a TRichEdit:)
I am making a chat prog and i want to insert emotion-icons, smileys
I have found something with ole functions, a lot of code, and it inserts the image by
  copying the TPicture in the clipboard and pasting it in the RichEdit
Do you know any other method to insert an image into TRichEdit?
And if you do, please tell me also how to search for any ':)' text in the richedit and transform it into the smiley image.
0
 

Author Comment

by:SandyXP
ID: 9642389
And btw, i need another thing:
Please tell me how to insert images into a TRichEdit:)
I am making a chat prog and i want to insert emotion-icons, smileys
I have found something with ole functions, a lot of code, and it inserts the image by
  copying the TPicture in the clipboard and pasting it in the RichEdit
Do you know any other method to insert an image into TRichEdit?
And if you do, please tell me also how to search for any ':)' text in the richedit and transform it into the smiley image.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

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