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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:41:35+00:00 2026-05-12T07:41:35+00:00

http://social.msdn.microsoft.com/forums/en-US/winforms/thread/e04e9308-bff5-4fbb-8cd6-0b2cd957aa68/?prof=required According to another forum, this is not a MS issue, because they say

  • 0

http://social.msdn.microsoft.com/forums/en-US/winforms/thread/e04e9308-bff5-4fbb-8cd6-0b2cd957aa68/?prof=required

According to another forum, this is not a MS issue, because they say that is the “native” behavior of the CombBox.

If the ComboBox has a DropDownStyle = DropDown and changes its size, the text is highlighted, if the form has many ComboBox seems that the controls are selected.

To avoid this issue one guy suggest to override the WndProc.
Everything was working fine until just one client has reported an unhandled error

System.ArgumentOutOfRangeException: InvalidArgument=Value of '-2136611475' is not valid for 'start'.
Parameter name: start
   at System.Windows.Forms.ComboBox.Select(Int32 start, Int32 length)
   at System.Windows.Forms.ComboBox.set_SelectionLength(Int32 value)...............


class ComboBoxEx : ComboBox
{
    const int WM_SIZE = 5;

    protected override void WndProc(ref Message m)
    {
        switch(m.Msg)
        {
            case WM_SIZE:
                string text = Text;
                base.WndProc(ref m);

                //The exception strangely is trown here
                SelectionLength = 0;

                Text = text;
                break;

            default:
                base.WndProc(ref m);
                break;
        }
    }
}

I don’t know the reason why this is happening just with one client.

  • 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-12T07:41:35+00:00Added an answer on May 12, 2026 at 7:41 am

    I can’t think of a case that will cause that, but I have a workaround. I checked set_SelectionLength(Int32 value) in the reflector:

    this.Select(this.SelectionStart, value);
    

    I don’t no why SelectionStart suddenly become a negative number but you can cut the middleman and preform this workaround code:

    this.Select(0, 0);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this HeaderlessTabControl, which subclasses the classic TabControl. // From http://social.msdn.microsoft.com/forums/en-US/winforms/thread/c290832f-3b84-4200-aa4a-7a5dc4b8b5bb/ // Author:
I had posted this question on MSDN Forum http://social.msdn.microsoft.com/Forums/en/vsreportcontrols/thread/f00e3406-354d-4f54-acce-7b7f0ad4c90f But I am not getting
Using the tip provided by José Adan at http://social.msdn.microsoft.com/Forums/en-US/vstscode/thread/f6dec8c4-9752-4a9b-82fe-0822808fd386/ I was able to get
As per the trouble shooting guide for VS2010 Load Testing ( http://social.msdn.microsoft.com/Forums/en/vststest/thread/df043823-ffcf-46a4-9e47-1c4b8854ca13 ), I'm
I'm asking the same question here that I've already asked on msdn forums http://social.msdn.microsoft.com/Forums/en-US/netfxnetcom/thread/70f40a4c-8399-4629-9bfc-146524334daf
I've a must to create wcf service with parameter. I'm following this http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/8f18aed8-8e34-48ea-b8be-6c29ac3b4f41 First
As per this thread: http://social.msdn.microsoft.com/forums/en-US/csharpide/thread/f33c32df-14e4-4636-8c8e-c96f66666cb5/ I can modify a C# project using notepad to
Found the answer here (last post): http://social.msdn.microsoft.com/Forums/eu/wcf/thread/f5c0ea22-1d45-484e-b2c0-e3bc9de20915 I'm having one last issue with the
I'm following the directions here: http://social.msdn.microsoft.com/forums/en-US/adodotnetentityframework/thread/0ce70e04-0ba0-4819-8898-87243203adb9/ to support mapping to a view that uses
I have the problem described here: http://social.msdn.microsoft.com/Forums/en-AU/csharplanguage/thread/b310c71a-2479-4a93-888a-29294cecbe09 They give a solution using a SerializationBinder.

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.