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 7039755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:50:11+00:00 2026-05-28T01:50:11+00:00

Currently, if I have a <TextBlock> element with font size 200, the entire element

  • 0

Currently, if I have a <TextBlock> element with font size 200, the entire element takes up much more space than needed.

Wasted Space

The blue outline (from Blend) shows the space the element takes up, when easily half of that is needed. Is there anyway I can eliminate that space such that my elements are not spaced out so much? I’ve tried margin, padding etc but most methods don’t seem to work.

Ideal

Ideally I would want the <textblock> to take up only the amount of space indicated by the red box

Edit:

With Lower Cased Letters

In response to stijn7, some space is indeed reserved for other letters (g,p,q etc). However there still is a lot of space at the top (1 is the highest character in Segoe UI). If clipping the textblock is not possible, is there anyway I can resize it such that there is no wasted space?

  • 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. Editorial Team
    Editorial Team
    2026-05-28T01:50:12+00:00Added an answer on May 28, 2026 at 1:50 am

    The problem here is that the TextBlock has the height incorporates the ascender and descender on order to render characters with a range of heights. The character you have chosen happens to span the font x-height, but not beyond. In order to achieve the effect you are after you will need a slightly lower level text rendering API, I would suggest trying the FormattedText class:

    Provides low-level control for drawing text in Windows Presentation
    Foundation (WPF) applications.

    This class has a MaxTextHeight property. I have not tried this, but there is a chance it will give you the information you require.

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

Sidebar

Related Questions

Unknown attribute Foreground on element TextBlock I have this error, when I'm trying to
i currently have a textblock that is embedded in a large grid. I have
currently i have a textblock placed in a scroll viewer control. How do i
I currently have an MS Access application that connects to a PostgreSQL database via
I currently have speakers set up both in my office and in my living
I currently have an existing database and I am using the LINQtoSQL generator tool
We currently have a company email server with Exchange, and a bulk email processing
I currently have a fairly robust server-side validation system in place, but I'm looking
I currently have heavily multi-threaded server application, and I'm shopping around for a good
We currently have code like this: Dim xDoc = XDocument.Load(myXMLFilePath) The only way we

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.