Select Microsoft windows common controls 6.0 (SP6) from components
Add a ListView control to the form.
Add 2 ImageList controls to the form.
Add some bitmaps to both the imagelist.
Set the name of image list to the Normal and small icon Image List from the Image lists tab in property pallet of the Listview control.
Add a combobox .
Add this sample code to the form
=============== ============== -
Private Sub Combo1_Click()
-
LV1.View = Combo1.ListIndex
-
End Sub
-
-
Private Sub Form_Load()
-
Dim C As ColumnHeader
-
Dim i As Integer
-
For i = 1 To 4
-
Set C = LV1.ColumnHeaders.Add()
-
C.Text = "Field" & i
-
C.Width = LV1.Width / 4
-
Next i
-
-
Dim li1 As ListItem
-
Set li1 = LV1.ListItems.Add()
-
li1.Text = "Item 1"
-
li1.Icon = 4
-
li1.SmallIcon = 1
-
LV1.ListItems(1).ListSubItems.Add , , "Field2"
-
LV1.ListItems(1).ListSubItems.Add , , "Field3"
-
LV1.ListItems(1).ListSubItems.Add , , "Field4"
-
-
Dim li2 As ListItem
-
Set li2 = LV1.ListItems.Add()
-
li2.Text = "Item 2"
-
li2.Icon = 4
-
li2.SmallIcon = 1
-
LV1.ListItems(2).ListSubItems.Add , , "Field2"
-
LV1.ListItems(2).ListSubItems.Add , , "Field3"
-
LV1.ListItems(2).ListSubItems.Add , , "Field4"
-
-
Dim li3 As ListItem
-
Set li3 = LV1.ListItems.Add()
-
li3.Text = "Item 3"
-
li3.Icon = 4
-
li3.SmallIcon = 1
-
LV1.ListItems(3).ListSubItems.Add , , "Field2"
-
LV1.ListItems(3).ListSubItems.Add , , "Field3"
-
LV1.ListItems(3).ListSubItems.Add , , "Field4"
-
-
With Combo1
-
.AddItem "Icon View"
-
.AddItem "Small Icon View"
-
.AddItem "List View"
-
.AddItem "Report View"
-
End With
-
-
End Sub
-
-
0 17872 Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Angelina |
last post by:
Hi,
I wanted to add a few items to my listview control. The
values of these will be obtained from other controls on
my interface. When the user clicks the select button,
they will need to be added to my listview. This is what i
need help doing.
I have added the columns to the listview but i now want
to add the values that correspond to these columns so
that they all appear in a single row.
|
by: Eva |
last post by:
Hi,
I wanted to know how i can enter values into a specific
column of a listview. I have tried the following code but
this seems to enter all my values into the first column!!!
Can anyone please help me out on this??
hers my code so far.....
|
by: cybertof |
last post by:
Hello,
Is there a solution to the following problem :
When filling a listview (30 columns) with around 5000 items, it can take
easily 10 sec for the listview to be filled.
I have used BeginUpdate and SuspendLayout but no speed...
Here is a flavor of the code :
|
by: Maheshkumar.R |
last post by:
How i can store images in array @ runtime..? What are the possbile ways..
Thankz..
-
Mähésh Kumär. R
|
by: Holmes |
last post by:
Hello
Ran into a bit of a problem here and have now exhausted my resources to getting this working
What I am trying to do is load and show a simple vb form with a listbox in it
Dim frm_nc_code As New frm_nc_sen
frm_nc_code.Show(
Well what I want to have happen is it loads the form then shows all of the controls on the form (especially the listview control which should be blank at this time)
| |
by: Ash Phillips |
last post by:
Hi Everyone,
I have this program I wrote in VB6 for family use. It's a DVD Database just
for me to keep track of them cause I have so many lol.
In VB6, I could add items to the ListView in 'frmMain' from 'frmAdd' with
the following code:
Private Function AddEntry(Title As String, Rating As String, Genre As
String, OnLoan As Boolean, ToWho As String)
|
by: dotnetnewbie |
last post by:
Whilst looping through items in a listview I wish to have the option of
inserting a new row (in the middle not necessarily at the end of the
listview).
thus if lvw is the listview name
dim itm as listviewitem
For each itm in lvw.Items
'if certain condition is met then insert new row in the listview here
|
by: Steve K. |
last post by:
I understand the concepts and rules for invoking UI methods from a non-UI
thread. In the past I have always checked with the control's InvokeRequired
property and Invoked my delegate accordingly. This has worked fine, nothing
special.
BUT, I am now working on my first client/server app and I have a slightly
new challenge that I'm not finding a good solution for.
My client passes an EventShim with a callback to the server. When...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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...
| |
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...
|
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();...
|
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...
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |