Author Topic: User Control Layout/Positioning  (Read 2414 times)

0 Members and 1 Guest are viewing this topic.

Atook

  • Swamp Rat
  • Posts: 1030
  • AKA Tim
User Control Layout/Positioning
« on: July 04, 2016, 03:23:14 PM »
Having some trouble tweaking the label position for dropdown box.

In design.png, you can see that the visual studio designer shows the labels how I want them.

actual.png shows interference with the label overlapping the dropdown box.

labels and dropdown boxes are set with anchors top and left.

I have windows set to show text items at 125% in display settings, but I figured anchor would take care of that. Any ideas?

MickD

  • King Gator
  • Posts: 3652
  • (x-in)->[process]->(y-out) ... simples!
Re: User Control Layout/Positioning
« Reply #1 on: July 04, 2016, 08:16:02 PM »
just off the top of my head you can try adjusting the margin or padding of the labels or set the background clour to clear.
hth
"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.”
- J.R.R. Tolkien

Atook

  • Swamp Rat
  • Posts: 1030
  • AKA Tim
Re: User Control Layout/Positioning
« Reply #2 on: July 05, 2016, 02:26:14 AM »
Thanks MickD.

Increasing bottom margin on the label and top margin on the dropdown box did not help. There wasn't an obvious way to make the background clear, so I didn't pursue that route.

I ended up increasing the Y value of the position 1 pixel down which cleared it up. Seems like an imperfect solution that will come back to me once a user has some ultra hi def screen and jacked their text sizes up to 200%


huiz

  • Swamp Rat
  • Posts: 919
  • Certified Prof C3D
Re: User Control Layout/Positioning
« Reply #3 on: July 05, 2016, 02:33:17 AM »
Do you have the AutoScaleMode set to DPI?

Also you can bring the label down, under the pulldown.
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: User Control Layout/Positioning
« Reply #4 on: July 05, 2016, 10:12:53 AM »
Somewhat out of the box, and requires a little more work, but you could use a temporary placeholder entry in the list with the title text ie. when the dialog comes up the left drop-down has "Manufacturer" in it until the user picks something from it.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

Atook

  • Swamp Rat
  • Posts: 1030
  • AKA Tim
Re: User Control Layout/Positioning
« Reply #5 on: July 05, 2016, 12:55:39 PM »
Do you have the AutoScaleMode set to DPI?
...
Thanks for pointing this out, once I read it, I was sure it was the problem. Kean wrote about it here.

Took me a while to find it, turns out it's on the background of the control, not the controls themselves. Unfortunately, the change made it worse. I'm wondering if it's related to the way the palettes are coded. I've noticed that AutoCad doesn't do well in general with DPI scaling on hi-res screens.

Looks like I'll stick to a manual adjustment of 1px down for now, thought it feels like a kludge fix.


CADbloke

  • Bull Frog
  • Posts: 345
  • Crash Test Dummy
Re: User Control Layout/Positioning
« Reply #6 on: July 05, 2016, 10:09:49 PM »
Try changing the z-order of the controls, set the dropdowns in front of the labels. Your research could start here: http://stackoverflow.com/questions/3213270/how-to-set-z-order-of-a-control-using-winforms or here too: http://stackoverflow.com/questions/1351054/winform-ui-components-layer-order

Atook

  • Swamp Rat
  • Posts: 1030
  • AKA Tim
Re: User Control Layout/Positioning
« Reply #7 on: July 05, 2016, 11:58:36 PM »
Thanks CADbloke! I had looked for a z-order, but didn't see it.

Calling .BringToFront() for the dropdown boxes in the controls constructor did the trick just fine.

I cranked the scaling up to 200% just to see if it would look terrible, and it actually looked fine.