Delphi – How to align the left and top control without a fixed width?

I have 6 RichEdit controls in the ScrollBox. They need to be aligned in order from top to bottom, but I need the width to be not fixed, so when the text length exceeds the ScrollBox width, I can use Scroll to view the full text.

If I set:

RichEdit1.Align := alTop;
RichEdit2.Align := alTop;
RichEdit3.Align := alTop;
RichEdit4.Align := alTop;
RichEdit5.Align := alTop;
RichEdit6.Align := alTop;

They are perfectly aligned and maintain a fixed design, so they cannot be moved accidentally, but the width is fixed. Not good.

If I align them manually, they will not be fixed when I click on them and can Move, I need to rearrange all the time. Annoying.

The picture is displayed on all RichEdits, Align = alTop and the width is fixed to the ScrollBox width.
The example below is to manually align all RichEdits, the width can exceed the ScrollBox Width, but they can be moved in the design:

enter image description here

p>

So, I want to fix them on the left, the top is the same as alTop, but don’t fix the width. How can I do this?

Use Align = alTop at design time. Then, at runtime (for example, OnCreate of the form) Set Align: = alNone, and change the width as needed.

I have 6 RichEdit controls in the ScrollBox. They need to be aligned in order from top to bottom, but I need the width to be not fixed, Therefore, when the text length exceeds the width of the ScrollBox, I can use the scroll bar to scroll to view the full text.

If I set:

RichEdit1.Align: = alTop;
RichEdit2.Align := alTop;
RichEdit3.Align := alTop;
RichEdit4.Align := alTop;
RichEdit5.Align := alTop;
RichEdit6.Align := alTop;

They are perfectly aligned and maintain a fixed design, so they cannot be moved accidentally, but the width is fixed. Not good.

If I align them manually, Then when you click on them, they will not be fixed and can be moved, I need to rearrange them all the time. Annoying.

The picture is displayed on all RichEdits, Align = alTop and the width is fixed to the ScrollBox width.
Below The example is to manually align all RichEdits, the width can exceed the width of the ScrollBox, but they can be moved in the design:

enter image description here

So, I want to fix them on the left, the top is the same as alTop, but don’t fix the width. How can I do this?

Use Align=alTop at design time. Then, set Align:=alNone at runtime (for example, OnCreate of the form), and change the width as needed.

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 3132 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.