0

This question comes form winform auto resize. After setting AutoResize and Dock property of my Form, the UI resizes nicely when changing DPI (going from desktop to laptop), except for one thing : the InputBox originally designed with fixed width to fit the length of user input shrank and user input no longer fits. Is there a way to set the InputBox width to always hold a number of chars?

Or, is there any way to force the InputBox to stay the same width when changing DPI?

Yituo
  • 1,284
  • 3
  • 15
  • 22
  • 1
    Characters have different width unless you use a mono-spaced font. Take a look at this post, it may help: [How do I (elegantly) transpose textbox over label at specific part of string?](https://stackoverflow.com/q/48401824/3110834) – Reza Aghaei Oct 09 '18 at 03:07
  • How did you measure this User input (beforehand?) to be sure the TextBox width will be set correctly?. Are you using a fixed size font with a pre-defined text length? The SO question that Reza Aghaei linked, answers this in many ways, but you might have some specific context. Maybe, define better this context if you don't find something that fits. – Jimi Oct 09 '18 at 04:02

0 Answers0