473,796 Members | 2,629 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

A trick to 'minimize' for ListView?

R
Minimizing an app that uses a ListView in a custom control causes all
entries in the ListView to disappear, never to return. What would
affect this?
Jun 17 '07 #1
5 1561
I've never seen this; can you provide example code to reproduce?

Marc

Jun 17 '07 #2
R
On Sun, 17 Jun 2007 00:28:15 -0700, Marc Gravell
<ma**********@g mail.comwrote:
>I've never seen this; can you provide example code to reproduce?

Marc
I guess I may have to trim down that section of code to see where it
breaks. Tedious though. So this is not something that's known? I
thought I had seen mention of something like this before.
Jun 17 '07 #3
On Sun, 17 Jun 2007 01:30:37 -0700, R <R@nospam.comwr ote:
I guess I may have to trim down that section of code to see where it
breaks.
Yes, that would be a good idea.
Tedious though.
Sometimes debugging is tedious, yes. Still, the very first thing to do
when using a third-party library (even .NET) is to make sure there's
nothing wrong with your own end of things, and one of the best ways to do
that is to simplify your scenario to the most basic elements.

At the very least, you will usually wind up figuring out what exactly
causes the third-party library to break (they do occasionally have bugs,
but usually not in the most obvious, well-used places), which can lead to
a good work-around. And frequently you'll discover that there's something
you've done specifically to cause the third-party library to "break",
revealing that the only thing that's broken is how the third-party library
is used by your own code. :)
So this is not something that's known? I
thought I had seen mention of something like this before.
Never heard of it. I would expect that the general case -- put a ListView
on a minimizable form, populate it, minimize it -- would obviously not be
broken, so the real question is what else are you doing that in
combination with those steps causes the ListView to wind up empty.

If and when you figure that out, please post back here, whether it's a bug
in your code or not. Even if it's a bug in your own code, it may well be
something that someone else might do accidently as well. Having the
solution here will help those people in the future. It's very unusual to
write a bug into code that no one else ever has, and never will, write
into their own code. :)

Pete

Jun 17 '07 #4
Quick thought: did you perhaps call BeginUpdate without calling
EndUpdate? This could conceivably have this effect... As a general
rule, you should use try/finally with such operations, i.e.

someControl.Beg inUpdate(); // or SuspendLayout()
try {
// your code
} finally {
someControl.End Update(); // or ResumeLayout()
}

Marc

Jun 17 '07 #5
On 17 Jun., 07:34, R <R...@nospam.co mwrote:
Minimizing an app that uses a ListView in a custom control causes all
entries in the ListView to disappear, never to return. What would
affect this?
While playing around with an OwnerDrawn ListView I came across a
problem that seems somewhat similar:
I wanted to create a ListView that used gradient colors in the headers
as well as in the background of the entire ListView, so I handled
OnDrawColumnHea der and OnPaintBackgrou nd to do my painting, while Item
and Subitem painting were left to the default behavior.
While the gradient effect worked as expected, I couldn't see any of
the items I added to the ListView, it appears that the
OnPaintBackgrou nd method was called after the other paint-methods,
causing me to draw over the previously drawn items.
Since it was just for testing purposes anyways I never got around to
looking into the problem (it is very much possible that I simply made
a mistake, though I seem to remember others reporting similar issues
on Google), but maybe it is relevant to yours.

hth,
Kevin Wienhold

Jun 18 '07 #6

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

Similar topics

6
2638
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 am populating listview with more than 200,000 items. It is too slow and tried virtual listview. But that doesnot allow me to add images in the listview. So now trying to list only the page user scrolls to.
0
489
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 am populating listview with more than 200,000 items. It is too slow and tried virtual listview. But that doesnot allow me to add images in the listview. So now trying to list only the page user scrolls to.
6
4661
by: VM | last post by:
How can I fill up a listview with text file contents? My listview has two columns and the first column fills up with a while loop: while (myString != null) { myString = sr.Readline(); listView1.Items.Add (myString); } Is there a way I can fill up the second column this easily? Thw way I'm currently doing it is using the subitems property to add it. Unfortunately,
0
2232
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 ("Col1",200,HorizontalAlignment.Left); listview.Columns.Add ("Col2",800,HorizontalAlignment.Left);
7
6451
by: Dave Y | last post by:
I am a newbie to C# and am having trouble trying to override a ListView property method. I have created a new class derived from the Forms.Listview and I cannot figure out the syntax to override ListView.Items.Add(), . I see that it is a virtual method so it should be easy to do. If anyone can help I would appreciate it greatly. I can do what I need to do in a different way this would just make everything significantly cleaner and eaasier...
7
15009
by: BobAchgill | last post by:
I am trying to decide which of these controls to use to implement letting my user select a full row from MyList. The MyList has several columns which would be nice to sort by at run time. The MyList data is resident in a dataset table. I'm stuck and can't choose either because. If I choose ListView as my control I don't understand how to programmatically get the data from the dataset table
2
6832
by: Peter | last post by:
Hi, I have a problem with Listview using checkboxes. If i check items by code BEFORE the form is shown the Listview.Items are confused during the ItemChecked Event !!! After showing the form every thing works fine: checking items by code
4
4520
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 is that when clicking on the "Show details" button the ListView for the appropriate row binds in the codebehind and displays the detail data for the selected row. I did something similar with a gridview control previously, but want to be able to...
5
10780
by: =?Utf-8?B?SmFtZXMgV29uZw==?= | last post by:
Dear all, I'd like to know if there is any method to minimize command mode window when a console program is running. In my case, there are several console programs which run periodically in server. Now, every console program instance will open a command mode window and they occupy the whole screen. I want to minimize all of them and maximize it if neccessary by manual. Is it possible and how to do it? I'm using VB.NET 2005. ...
0
9679
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9527
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9050
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7546
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6785
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5441
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.