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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:40:44+00:00 2026-05-26T16:40:44+00:00

I use listview but prefer the column size to be fixed. Have no idea

  • 0

I use listview but prefer the column size to be fixed. Have no idea how to do this. Can anyone help me?

  • 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-26T16:40:45+00:00Added an answer on May 26, 2026 at 4:40 pm

    i am hoping that you are using winforms…then you can do like this…

    by calling listview AutoResizeColumn property …..

    take a look at this link for more info

        private ListView resizingListView = new ListView();
        private Button button1 = new Button();
    
        private void InitializeResizingListView()
        {
            // Set location and text for button.
            button1.Location = new Point(100, 15);
            button1.Text = "Resize";
            button1.Click += new EventHandler(button1_Click);
    
            // Set the ListView to details view.
            resizingListView.View = View.Details;
    
            //Set size, location and populate the ListView.
            resizingListView.Size = new Size(200, 100);
            resizingListView.Location = new Point(40, 40);
            resizingListView.Columns.Add("HeaderSize");
            resizingListView.Columns.Add("ColumnContent");
            ListViewItem listItem1 = new ListViewItem("Short");
            ListViewItem listItem2 = new ListViewItem("Tiny");
            listItem1.SubItems.Add(new ListViewItem.ListViewSubItem( 
                    listItem1, "Something longer"));
            listItem2.SubItems.Add(new ListViewItem.ListViewSubItem(
                listItem2, "Something even longer"));
            resizingListView.Items.Add(listItem1);
            resizingListView.Items.Add(listItem2);
    
            // Add the ListView and the Button to the form.
            this.Controls.Add(resizingListView);
            this.Controls.Add(button1);
        }
    
        private void button1_Click(object sender, EventArgs e)
        {
            resizingListView.AutoResizeColumn(0, 
                ColumnHeaderAutoResizeStyle.HeaderSize);
            resizingListView.AutoResizeColumn(1, 
                ColumnHeaderAutoResizeStyle.ColumnContent);
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use a ListView for text-items in my APP. But I have one problem:
In WPF, I know I can use ListView.ScrollIntoView to scroll a particular item into
I have a listview with 200 items. I use a custom view for each
Listview has a data-inset property to make its corners rounded. However, I can't use
How do I use the ListView 's ItemSelectionChanged event? I have a ListView ,
I use this XAML code for the ListView: <ListView> <ListView.View> <GridView> <GridViewColumn DisplayMemberBinding={Binding Path=Flag}
I'm trying to build a Listview EDIT/Insert template where I can use a checkbox
I am developing a soundboard application in which I use Listview Activity. But since
I am developing a soundboard application in which I use Listview Activity. But since
Hi how i can use custom listview with textview and imageview.i tried following code

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.