-
Jun 12th, 2021, 03:58 AM
#1
Thread Starter
Addicted Member
An Ideal option required instead of Listbox. Coud you suggest
Hello
What is the ideal object on Windows(App...Vb.net Frame...) Userform instead of Listbox with MultipleColumn and without columncount
As Columncount is not member of List box in the userform.
What i would like is to have a replica of listbox of Multiple Columns with a check box as VBA userform had Listbox.Liststyle = frmListStyleoption and in VBA i could add max columns as 10 with below some Critical Properties of Listbox
Listbox.Multiselect = fmMultiSelect
Listbox.SpecialEffect = frmSpecialeffectSunken
Listbox.TextAlign = fmTextAlignLeft
Listbox.MatchEntry = fmMatchEntryFirstLetter
Listbox.Columncount = 10
Listbox.ColumnWidths = "80,55,80,80,100,80,50,35,55"
With the above listbox it had CheckBox for selection inside. Then Seperate Label.Caption which acted as header and Text inside were placed in such a way that text placed above the columns exactly. So Represented Column Headername.
With the above listbox had 2 checkoxes seperately in userform for Selection of All items and Unselection of all items
With the above scenario of Listbox of VBA What would be more Fantastic option me to incorporate the right object in the userform.
Below Data in another worksheet. And how may columns could be added in that object and formatting of those columns.
Code:
Col A Col B Col C Col D uptlil Col J
Fruit Apple 52 240/Kg ......
Fruit Kiwi 24 180/Kg .....
Fruit Pineaapple 36 220/Kg .....
Textbox1.Text ="Fruit" then Listbox will display the above data with Full selection with Ticked checkbox
Thanks
SamD
23 Thread 4: 892229
Last edited by SamDsouza; Jun 12th, 2021 at 04:08 AM.
-
Jun 12th, 2021, 05:11 AM
#2
Re: An Ideal option required instead of Listbox. Coud you suggest
The ListView control can be used as a multi-column ListBox. Set the View property to Details.
Google it for an example...
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jun 12th, 2021, 11:39 PM
#3
Thread Starter
Addicted Member
Re: An Ideal option required instead of Listbox. Coud you suggest
.Paul.
Thanks for the suggestion let me give it a try and revert back.
The ListView control can be used as a multi-column ListBox. Set the View property to Details.
Google it for an example...
Thanks
SamD
24 Thread 4: 892229
-
Jun 14th, 2021, 08:14 AM
#4
Re: An Ideal option required instead of Listbox. Coud you suggest
If you need some code samples check out the following GitHub repository and article. Code samples use SQL-Server to populate ListView controls yet any database can be used or no database.
-
Jun 16th, 2021, 08:37 AM
#5
Thread Starter
Addicted Member
Re: An Ideal option required instead of Listbox. Coud you suggest
Karen
If you need some code samples check out the following GitHub repository and article. Code samples use SQL-Server to populate ListView controls yet any database can be used or no database.
Thank you so much for the reference. Yes, will love to go through it and revert back. Mostly queries from my side shall be for MS-Excel at present.
FYI have gone through your solutions on few of the forums
Thanks
SamD
29 Thread 4: 892229
-
Jun 16th, 2021, 05:40 PM
#6
Re: An Ideal option required instead of Listbox. Coud you suggest
The ListView is not the best choice for displaying from a database. The ListView is a display control, but the DataGridView is designed to be used with databases. There are plenty of properties you can change to alter the appearance of the DataGridView as much or as little as you choose. It can also be used as a read only control, which the ListView would also be.
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jun 16th, 2021, 09:52 PM
#7
Thread Starter
Addicted Member
Re: An Ideal option required instead of Listbox. Coud you suggest
Paul
The ListView is not the best choice for displaying from a database. The ListView is a display control, but the DataGridView is designed to be used with databases. There are plenty of properties you can change to alter the appearance of the DataGridView as much or as little as you choose. It can also be used as a read only control, which the ListView would also be.
Hmmmm Ok. Seems Very Intresting
As per your reply#2. I started using ListView.
Let me know for Viewing an Excel Sheet AsIs will Datagrid be ok ? if not then which is the object to view Excel Sheet. on the userform
Although there are commands to Open and view the xlsx files.
Thanks
SamD
31 Thread 4: 892229
-
Jun 16th, 2021, 11:44 PM
#8
Re: An Ideal option required instead of Listbox. Coud you suggest
You can query an Excel Worksheet with SQL, then bind it to the DataGridView
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jun 17th, 2021, 12:14 AM
#9
Thread Starter
Addicted Member
Re: An Ideal option required instead of Listbox. Coud you suggest
Paul
You can query an Excel Worksheet with SQL, then bind it to the DataGridView
Unfortunately no knowledge of SQL. May be leave it here.
Nevertheless let the oppurtunity come will see at that time.
SamD
33 Thread 4: 892229
-
Jun 17th, 2021, 01:21 AM
#10
Re: An Ideal option required instead of Listbox. Coud you suggest
Originally Posted by SamDsouza
Paul
Unfortunately no knowledge of SQL. May be leave it here.
Nevertheless let the oppurtunity come will see at that time.
SamD
33 Thread 4: 892229
I gave you a sample with OLEDB .. here ..
https://www.vbforums.com/showthread....=1#post5524714
Post#8 you just need to try,use it
to hunt a species to extinction is not logical !
since 2010 the number of Tigers are rising again in 2016 - 3900 were counted. with Baby Callas it's 3901, my wife and I had 2-3 months the privilege of raising a Baby Tiger.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|