Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

TEdit on TToolBar

Posted on 2001-07-20
12
Medium Priority
?
415 Views
Last Modified: 2010-04-06
Hello out there,

I'm having a problem that currently is behind my horizont.

Maybe it's simple for you ;-)

As you can see on the picture at http://www.omsec.com/problem.jpg I am dealing with a normal TEdit-Box on a TToolBar-Menu. I have several buttons on the left of the ToolBar and now I'd like to fill up the remaining Space on the right with the TEdit-Box, also when the Size of the Form changes.

Any Ideas ?

Cheers, Roger
0
Comment
Question by:omsec
[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
  • 3
  • 3
  • 2
  • +3
12 Comments
 
LVL 2

Author Comment

by:omsec
ID: 6303456
sorry
the correct URL is http://www.omsec.com/problem.gif

...the TEdit should behave like it has an Align-Property (which isn't present in D5 ENT)
0
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6303473
your link not work, try to put the right link plz
I don't know what's the problem with put editbox in the toolbar?

  if you want to add editbox into the toolbar at the run time, you can do that simply

 Edit1.Parent := ToolBar1;

maybe i don't understand you well, so i'm waiting for the right link

Mohammed
0
 
LVL 22

Accepted Solution

by:
Mohammed Nasman earned 200 total points
ID: 6303502
Hello

  Do you mean you want all the space after the buttons to fill with the Edit box?

 if that what you mean at this code onresize event

procedure TForm1.FormResize(Sender: TObject);
begin
  Edit1.Width := Toolbar1.width - Edit1.Left;
end;

Best regards
Mohammed Nasman
0
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!

 
LVL 2

Assisted Solution

by:bugroger
bugroger earned 200 total points
ID: 6303518
Hi omsec,

Try This:

Set these code in your form-resize event.
Maybe you must change the Edit and the Toolbar name.

 Edit1.Width := ToolBar1.Width - Edit1.Left;

GL
 BUG
0
 
LVL 2

Expert Comment

by:bugroger
ID: 6303529
mnasman,
 You was faster.
 I saw your code after i have submitted my comment :(

 

0
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6303570
don't worry bugroger, that's happen to me alot :)
0
 

Expert Comment

by:tearsoftragedy
ID: 6304437
Hey Omsec!!....

it's almost the same code i gave you in the #delphi channel... hehehe... i though you were happy with it...

0
 
LVL 2

Author Comment

by:omsec
ID: 6316513
lol, i wonder....

but this doesn't behave as expected. When I maximize the form and then minimize it, the Edit suddenly fills the entire ToolBar and the Buttons can't be reached anymore, unless the application is restarted....
0
 
LVL 2

Expert Comment

by:bugroger
ID: 6317434
If i maximize the form and then minimize it
the edit "does not" fill the entire ToolBar.

Here is my code:

//--------------------------------------------------------
unit TB;

interface

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

type
  TForm1 = class(TForm)
    ToolBar1: TToolBar;
    Edit1: TEdit;
    Button1: TButton;
    Button2: TButton;
    procedure FormResize(Sender: TObject);
    procedure ToolBar1Resize(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FormResize(Sender: TObject);
begin
 Edit1.Width := ToolBar1.Width - Edit1.Left;
end;

procedure TForm1.ToolBar1Resize(Sender: TObject);
begin
// Edit1.Width := ToolBar1.Width - Edit1.Left;
end;

end.
//------------------------------------------------------

//=============== DFM ==================================
object Form1: TForm1
  Left = 197
  Top = 168
  Width = 547
  Height = 369
  Caption = 'Form1'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  OnResize = FormResize
  PixelsPerInch = 96
  TextHeight = 13
  object ToolBar1: TToolBar
    Left = 0
    Top = 0
    Width = 539
    Height = 29
    ButtonHeight = 21
    Caption = 'ToolBar1'
    TabOrder = 0
    object Button1: TButton
      Left = 0
      Top = 2
      Width = 75
      Height = 21
      Caption = 'Button1'
      TabOrder = 1
    end
    object Button2: TButton
      Left = 75
      Top = 2
      Width = 75
      Height = 21
      Caption = 'Button2'
      TabOrder = 2
    end
    object Edit1: TEdit
      Left = 150
      Top = 2
      Width = 386
      Height = 21
      AutoSize = False
      TabOrder = 0
      Text = 'Edit1'
    end
  end
end

//=============== DFM ==================================

0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6908047
ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101 or Netminder will return to finalize these if still open in seven days.  Please post closing recommendations before that time.

Question(s) below appears to have been abandoned. Your options are:
 
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you, but may help others. You must tell the participants why you wish to do this, and allow for Expert response.  This choice will include a refund to you, and will move this question to our PAQ (Previously Asked Question) database.  If you found information outside this question thread, please add it.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question (if it has no potential value for others).
   --> Post comments for expert of your intention to delete and why
   --> You cannot delete a question with comments, special handling by a Moderator is required.

For special handling needs, please post a zero point question in the link below and include the URL (question QID/link) that it regards with details.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click the Help Desk link on the left for Member Guidelines, Member Agreement and the Question/Answer process for further information, if needed.  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

Click you Member Profile to view your question history and keep them all current with updates as the collaboration effort continues, to track all your open and locked questions at this site.  If you are an EE Pro user, use the Power Search option to find them.  Anytime you have questions which are LOCKED with a Proposed Answer but does not serve your needs, please reject it and add comments as to why.  In addition, when you do grade the question, if the grade is less than an A, please add a comment as to why.  This helps all involved, as well as future persons who may access this item in the future to seek help.

To view your open questions, please click the following link(s) and keep them all current with updates.
http://www.experts-exchange.com/questions/Q.11896578.html
http://www.experts-exchange.com/questions/Q.20109588.html
http://www.experts-exchange.com/questions/Q.20154494.html
http://www.experts-exchange.com/questions/Q.20156716.html
http://www.experts-exchange.com/questions/Q.20237072.html


To view your locked questions, please click the following link(s) and evaluate the proposed answer.
http://www.experts-exchange.com/questions/Q.20236974.html

PLEASE DO NOT AWARD THE POINTS TO ME.  
 
------------>  EXPERTS:  Please leave any comments regarding your closing recommendations if this item remains inactive another seven (7) days.  Also, if you are interested in the cleanup effort, please click this link http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643

Moderators will finalize this question if still open in 7 days, by either moving this to the PAQ (Previously Asked Questions) at zero points, deleting it or awarding expert(s) when recommendations are made, or an independent determination can be made.  Expert input is always appreciated to determine the fair outcome.
 
Thank you everyone.
 
Moondancer
Moderator @ Experts Exchange
0
 
LVL 26

Expert Comment

by:Russell Libby
ID: 8711181
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

To split points between bugroger and mnasman

Note:
Both the Form and Toolbar resize events must be coded to handle the setting of the edit width to work correctly, thus the reason for the split.

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Thank you,
Russell

EE Cleanup Volunteer
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Screencast - Getting to Know the Pipeline
Suggested Courses

597 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