Results 1 to 7 of 7

Thread: Aligning controls with docking

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2007
    Location
    cobwebbed to PC
    Posts
    311

    Aligning controls with docking

    Hi folks,

    I have a DataRepeater.ItemTemplate I have added some items too as shown in the first image. From the left of the template I have 5 labels then a progress bar, then a button.

    Name:  DataRptr_ScrnSht.png
Views: 184
Size:  7.0 KB

    The DataRepeater is anchored to all sides of the form so that it grows and shrinks with the form as it is resized.

    The button on the ItemTemplate is docked right so that it stays at the right hand side of the template.

    The ProgressBar is where my issue lies. If I anchor it it stays where it is in position in relation to the ItemTemplate which is correct - but I also would like it to strech as the ItemTemplate does BUT not collide with the button...

    If I dock the ProgressBar to the right it moves right up against the right edge and the button gets pushed to the left of it, if I anchor it to the right as well as its current top and left, it stretches out to have its right edge constantly underneath the button...

    Name:  DataRptr_ScrnSht2.png
Views: 169
Size:  4.4 KB

    How can I get the progress bar to maintain position relative to the top left yet grow to the right - but not grow right to the edge of the containing template, only grow such that it has the same constant standoff from the right?

    Thanks
    Thanks

  2. #2
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Aligning controls with docking

    The X button should be Dock Right but also Anchor Top, Left. The ProgressBar Dock None, Anchor Top, Left, Right.

    Name:  a.png
Views: 125
Size:  2.9 KB

    Name:  a1.PNG
Views: 134
Size:  3.2 KB
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2007
    Location
    cobwebbed to PC
    Posts
    311

    Re: Aligning controls with docking

    Hey Dunfiddlin,

    Thanks for helping out, unfortunately that still gives me the same as the second image in my OP.
    Im still playing around with it (in between getting P'd off with it) but so far can only get it to either not stretch or stretch but finish behind the button.
    Very annoying because now I know it *should* be working but isn't for some kooky reason....

    Should it make a difference that the DataRepeater itself is anchored (top, bottom, left & right)?

    EDIT: no, no difference - switched DataRepeater anchoring to top & left but not a lemon
    Thanks

  4. #4
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Aligning controls with docking

    Are the labels AutoSize? If they are being sized according to content rather than size of the window that could well mess things up.
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  5. #5
    PowerPoster boops boops's Avatar
    Join Date
    Nov 2008
    Location
    Holland/France
    Posts
    3,201

    Re: Aligning controls with docking

    Using both docking and anchoring at the same time tends to get confusing. I suggest you try anchoring the X button top right; and the progress bar top, left and right. No docking.

    BB

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2007
    Location
    cobwebbed to PC
    Posts
    311

    Re: Aligning controls with docking

    OK I've tried setting the labels autosize to false (then had to widen them) then setting the docking and anchoring as boops boops mentioned... still no dice
    In this image you can see the layout in the design editor in the background and the running application in the foreground with the progress bar looking as if it is actually running off the right hand side of the ItemTemplate altogether
    I tried switching the ItemTemplate Autosize property from True to false, but again, no change.

    Name:  scrnsht4.png
Views: 118
Size:  42.1 KB
    Thanks

  7. #7
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Aligning controls with docking

    Yes, well. Boops is a bit off beam. Try with the settings I gave you in post #2 and AutoSize = False
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width