473,387 Members | 1,669 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

ScroolBar in ListView

Hello, Everybody!

I have problem in myListView control, inherited from ListView Class

I try to calculate width of some Column in LisrView (Detail) when after
resizing.
For this purpose I override OnResize method (see code below)

if I extend width of the MyListView - That's All OK.
BUT if I try to narrow the MyListView - I take the Horizontal ScrollBar,
which realy not need.

(After minimize/restore operation ScrollBar id diapear)
How to fix this bug?

Please, help.

private int m_iAlignColIndex = 1; // aligh 1 column
private int m_iMinWidth; //Minimum align column width value;
-----------------------------------
protected override void OnResize(EventArgs e)
{
base.OnResize(e);
this.SuspendLayout();
if (this.Columns.Count>1)
{
int width=Width-4;
for (int i=0; i<this.Columns.Count; i++)
{
if (i!=m_iAlignColIndex) width-=this.Columns[i].Width;
}
if (width<m_iMinWidth)
{
this.Columns[m_iAlignColIndex].Width=m_iMinWidth; // Set Minimum
Width and in this case we NEED ScrollBar
}
else
{
Columns[m_iAlignColIndex].Width=width;// In this place We DON"T
NEED ScrollBar
}
}
this.ResumeLayout(true);
}
-----------------------------------
--
Best Regards
---------------------------
Moldavanov Yura
ICQ#: 247077081
e-mail:un***********@rambler.ru
Nov 16 '05 #1
0 916

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Anushya | last post by:
Hi I am using Listview and inherited listview control overriding WndProc & PreProcessMessage in ListView. I need this to customize listview to display only the page the user scrolls to. Since i...
0
by: keith | last post by:
In a ListView control (two columns), I added a few ListView items. ListView listview=new ListView(); listview.Parent=this; listview.View=View.Details; listview.Columns.Add...
1
by: cyshao | last post by:
How to control the scroolbar.location of ListView? I have a ListView with many items. I want to locate ListView scrollBar to bottom, top, or some item. How can I do that ? Thanks Charles...
4
by: Brian Gaze | last post by:
I have created a ListView control and have bound this to a datasource. Within the ItemTemplate of the ListView I have added another ListViewControl which is databound in the code behind. The idea...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.