Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 37707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T14:35:34+00:00 2026-05-10T14:35:34+00:00

THis is a followup to my previous question Font-dependent control positioning. It’s an attempt

  • 0

THis is a followup to my previous question ‘Font-dependent control positioning.‘ It’s an attempt to solve the real problem behind that question, perhaps in ways different than the one I was asking about.

Example of the problem statement: I want a checkbox that says ‘Adjust prices by <X> <Y> after loading,’ where <X> is a number—adjustable with a NumericUpDown—and <Y> is either ‘percent’ or ‘dollars,’ with the choices being made by a ComboBox. This will be on a single line.

The complication: I want to be able to change my fonts for all these controls (basically setting them to System.Drawing.Fonts.MessageBoxFont, which is Tahoma 8 pt on Windows XP/etc. and Segoe UI 9 pt on Vista), without messing up my layout, which with my current Position-property–setting paradigm does not work.

More generally, I’d like the controls to be dynamically laid out in a font-independent way, so that the <X> NumericUpDown fits snugly into the space between ‘by ‘ and the <Y> ComboBox, and similarly the <X> ComboBox fits in with respect to the <X> CheckBox and the string ‘ after loading’ to its right.

The part everyone seems to miss: This is all nested within a CheckBox. So, ideally, clicking on the words ‘after loading’ should check/uncheck the checkbox, and draw that little highlight rectangle around ‘Adjust prices by          after loading.’ So just slapping an extra Label on the end doesn’t work, because then it doesn’t toggle the CheckBox; similarly, trying to band-aid things by hooking up such a Label‘s Click event won’t produce the desired highlight-rectangle.

Solutions? At this point I’m thinking either:

  1. Rethink the problem, somehow, maybe with an ugly solution like two separate lines of text: ‘Adjust found prices after loading’ (CheckBox), ‘Adjustment amount:’ (NumericUpDown and ComboBox). This is really bad because my options box is absolutely full of options of this type (i.e. the type in the example), so it would at least double in vertical size.

  2. Some sort of custom control? SplittableCheckBox?

  3. Some kind of magic with a TableLayout control? (Pretty sure this fails at ‘the part everyone seems to miss.)

  4. Give up and either go back to MS Sans Serif, or use Tahoma uniformly, or package Segoe UI with my application, thus disrespecting the system default fonts.

  5. (New, via edit) Switch to WPF, if someone can convince me that it supports this scenario exactly.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T14:35:34+00:00Added an answer on May 10, 2026 at 2:35 pm

    If you have several options that follow this layout, why not create a user control? The user control will contain the CheckBox, a NumericUpDown, a ComboBox and a label for the ‘after loading’. You can override OnFontChanged to adjust the location of the controls based on the rendering of the text with the given font. Add an EventHandler to the Label to check/uncheck the CheckBox.

    As for having the focus rectangle surround all of the controls, you should be able to give the user control focus when one of its inner controls is clicked.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this is actually a followup from a previous question but it contains different information
This is a follow up question to my previous question . I am trying
This is a follow up to a previous question; I got an answer I
This is a follow up on my previous question . I set up the
First of all, this is a follow up to a previous question of mine
This question is a follow up to a previous question I had I'm trying
this is a follow up question of my previous question So I have this
As sort of a follow up to this previous question: Normalizing a variety of
This is a follow-up to this question . I'm currently writing a simple game
I'm generating a list of replacement rules like this ops = {LessEqual, GreaterEqual}; ineqRules

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.