question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Textbox MaxLength > 32767 has no effect, may be documentation oversight

See original GitHub issue

Environment

Microsoft Visual Studio Community 2022 (64-bit) - Preview Version 17.6.0 Preview 3.0 <TargetFramework>net8.0-windows</TargetFramework> <LangVersion>preview</LangVersion> <Platforms>x64</Platforms>

.NET version

<TargetFramework>net8.0-windows</TargetFramework>

Did this work in a previous version of Visual Studio and/or previous .NET release?

I don’t know

Issue description

Setting TextBox MaxLength to e.g. 99_999, it still accepts only the first 32_727 characters.

Steps to reproduce

Put a textbox on a windows form. Copy text longer than 32_727 characters. Paste into this textbox. Textbox will accept the first 32_727 characters. Set MaxLength to 99_999. Textbox still accepts the first 32_767 characters only.

Diagnostics

// 
            // TbInput
            // 
            TbInput.Location = new Point(7, 124);
            TbInput.MaxLength = 99999;
            TbInput.Multiline = true;
            TbInput.Name = "TbInput";
            TbInput.ScrollBars = ScrollBars.Vertical;
            TbInput.Size = new Size(846, 523);
            TbInput.TabIndex = 21;
            TbInput.TextChanged += TbInput_TextChanged;

Issue Analytics

  • State:closed
  • Created 5 months ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Olina-Zhangcommented, Apr 14, 2023

I also do not reproduce the problem: when setting TextBox MaxLength to 99999 or 32767, it can accept corresponding number of characters.

0reactions
goroggycommented, Apr 27, 2023

Sorry again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Textbox MaxLength > 32767 has no effect, may be ...
Windows Forms is a .NET UI framework for building Windows desktop applications. - Textbox MaxLength > 32767 has no effect, may be documentation...
Read more >
How to override textbox's maxlength Properties for longer ...
Solution 1. Accept Solution Reject Solution. (1) Max Length never affects what a program can put in a text box, it only
Read more >
TextBox MaxLength over 32767 has no effect
Hi all I want to implement a textbox that includes a fixed string and user can't change it and just enter info after...
Read more >
TextBoxBase.MaxLength Property (System.Windows.Forms)
In code, you can set the value of the Text property to a value that has a length greater than the value specified...
Read more >
How to limit the number of characters allowed in a textbox?
The underlying problem is a multi-line textBox is rendered as a text-area and MaxLength is removed. We can also fix in the C#...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found