Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Empty Listviews


Reply
 
Thread Tools Display Modes
  #1  
Old 09-03-2003, 11:57 PM
QuantumCat's Avatar
QuantumCat QuantumCat is offline
Senior Contributor
 
Join Date: Aug 2003
Location: Dordrecht,Holland
Posts: 858
Default Empty Listviews


I have a datbase program that holds a lot of listviews.
I like a database to be "visual". The listviews give me a lot of overview on things.

Now every once in a while my listviews turn up empty (they are all in different windows).

Is there (again I couldn't find probablty because I don't know where to look) to have VB go and see if the LV is empty?


I mean something like:
if ListView1.listitems = empty Then(refresh ListView1)?
Reply With Quote
  #2  
Old 09-04-2003, 12:04 AM
BlueDragon BlueDragon is offline
Restricted
 
Join Date: Aug 2003
Location: Ohio, USA
Posts: 66
Default

Code:
If ListView1 = "" then ListView1.Refresh
Try this in the form load property
Reply With Quote
  #3  
Old 09-04-2003, 12:57 AM
QuantumCat's Avatar
QuantumCat QuantumCat is offline
Senior Contributor
 
Join Date: Aug 2003
Location: Dordrecht,Holland
Posts: 858
Default

No, doesn't work - he treats ListView1 = " " as an incomplete syntax
VB expects something like
ListView1.Listitems(j) or
ListView1.Listitems(j).item(i)
which both give an error (index out of bounds or something)


Quote:
Originally Posted by BlueDragon
Code:
If ListView1 = "" then ListView1.Refresh
Try this in the form load property

Reply With Quote
  #4  
Old 09-04-2003, 01:09 AM
irri irri is offline
Centurion
 
Join Date: Aug 2003
Posts: 134
Default

this should work
Code:
If (listview.ListItems.Count = 0) Then
__________________
!!! The smaller the mistake, The bigger the problem !!!
!!! When the end is near, embrace it..Why sufer if it isn't nessecery !!!
Reply With Quote
  #5  
Old 09-04-2003, 01:09 AM
BlueDragon BlueDragon is offline
Restricted
 
Join Date: Aug 2003
Location: Ohio, USA
Posts: 66
Default

Did you have "" or " ", theres a big difference.
Reply With Quote
  #6  
Old 09-04-2003, 02:04 AM
QuantumCat's Avatar
QuantumCat QuantumCat is offline
Senior Contributor
 
Join Date: Aug 2003
Location: Dordrecht,Holland
Posts: 858
Default

both -actually :-)
and I didn't try the count with () on each side

:-)

thnx


Quote:
Originally Posted by BlueDragon
Did you have "" or " ", theres a big difference.

Reply With Quote
  #7  
Old 11-16-2003, 11:57 PM
QuantumCat's Avatar
QuantumCat QuantumCat is offline
Senior Contributor
 
Join Date: Aug 2003
Location: Dordrecht,Holland
Posts: 858
Default

BTW most of my empty listviews were due to not clearing the headers, so everytime I made a refresh of the listview VB built it next to the prevrious giving a 15x22 columns with 77 rows before running out of workspace -hence the blank LV's

QC

Quote:
Originally Posted by QuantumCat
both -actually :-)
and I didn't try the count with () on each side

:-)

thnx


Quote:
Originally Posted by BlueDragon
Did you have "" or " ", theres a big difference.


Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Test for empty element of Array nagababa Database and Reporting 2 08-25-2003 02:36 PM
Deleting empty columns iFletch Excel 1 07-09-2003 08:38 AM
Mapping in ListView Boxes:Automatically using 3 listviews fordraiders General 0 07-02-2003 12:23 AM
Deletion Error Soccer King Database and Reporting 2 06-09-2003 09:42 PM
Empty line in datagrid with an empty recordset zombieman Database and Reporting 5 10-09-2002 06:12 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->