1. Ronald Hitzler
  2. PowerBuilder
  3. Monday, 10 January 2022 14:15 PM UTC

Hi community,

please apologize this simple question but I'm fairly new to PB (I've some experience with C#) and I want to know what the best option is to do the following:

I've datawindow containing several columns and I changed the presentation style from 0 (Form) to 1 (Grid) so that the columns can be resized by the user. The datawindows also contains a line control in its detail pane which is used for optical separation. 

The problem is that if a user resizes the columns the line control doesn't get resized automatically. What is the best option to adjust the width of the line object after resizing the columns?

One option I see is using a MouseUp Event after resizing and calculate the new width. I thought also about using an expression for the width of the line control but I have no idea if this possible at all and how such an expression looks like?

 

Can you give me some insight please? Many thanks

 

B. rgds,

Accepted Answer
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Monday, 10 January 2022 14:41 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Roland, 

See attached in pb2019 format.

Your are very right with your approach of using an expression.

What I did, is set the x1 of the line to the column "mycheck.x" and set x2 to the value of "mycheck.x" + "mycheck.width", just look at the attributes withing the position tabpage of the line control on the d_test1 object.

regards

Attachments (1)
Comment
There are no comments made yet.
Ronald Hitzler Accepted Answer Pending Moderation
  1. Tuesday, 11 January 2022 14:52 PM UTC
  2. PowerBuilder
  3. # 1

Miguel and René,

many thanks for your answers. You helped me very much!

Absolutely fantastic, you're awesome!

 

 

Comment
There are no comments made yet.
René Ullrich Accepted Answer Pending Moderation
  1. Monday, 10 January 2022 14:48 PM UTC
  2. PowerBuilder
  3. # 2

Hi Ronald,

Yes, you can do it with an expression. So you don't need any other code.

As expression you have to evaluate the position and width of the column using the describe function.

e.g. the expression for x2 may be

long (describe ('yourcolumn.X')) + long (describe ('yourcolumn.width'))

HTH,

René

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.