How to add property to a ListBox? [closed] - c#

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
VB6 had a fileListBox with .path property and I am trying to add that property to regular listbox.
ListBox myfilelistbox = new ListBox();
and the one generated with XAML.

I think what you want is Attached Properties

ListBox is a generic control which displays list of items in a linear manner. What you wish to do is to display a hierarchy of items, not a list of them.
There are no such built in controls and you will have to build one for yourself or find some that others have implemented.
Check more information on this other Stack Overflow thread Is there a WPF control which will show a list of files in an Explorer-like view?.
The following article on CodeProject could help you: A WPF File ListView and ComboBox

Related

Custom toolbar in C# windows forms [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I'm trying to create a toolbar/menu as in the image below.
I've added a toolstrip control. It has some buttons with images and text below. But I don't know how to reproduce the "grouped" look in the image above.
Does someone have an idea how to do that?
The control in your image is a ribbon (not a toolbar, toolstrip or tooltip).
WinForms doesn't support ribbons out of the box. But it looks like there are ribbon controls available, such as RibbonWinForms on GitHub.

How I can make an Autocomplete TextField in WPF? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
How I can make an Autocomplete Text Field in WPF?
How I can include multiple value in text field.
Actually I'm trying to make an search bar in which Products are fetched from database and include in text field then.When i type a keyword it should be display an suggestion.
Re-template ComboBox to make it looks like TextBox.
Extend ComboBoxItem so that we can hightlight the already entered part in the dropdown list.
Get reference to the TextBox part of the ComboBox, and hook up TextBox.TextChanged event.
In the TextBox.TextChanged event handler, we filter the underlying datasource and create new list source with our customized ComboBox Items.
Hope this will be helpful.
Thank you

About ListBox limit item [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
Hello everyone,I am new here, can I ask a question:
Let's say I have a ListBox (with more than 5k items of all English words ). and a richTextBox.
And a ListBox usually load every items, right? How can I change my ListBox to just load/pick a few (maybe 10 items) from the data?
EXAMPLE:
**When a user type a word, I dont want my ListBox to load every thing starting with the word my user input. I just want my ListBox to load just a few item.(More to like a word prediction software) **
Please give an answer that is not too complicated, since I am a beginner.
Thanks, Teik Fai.
From your question, it looks like you need to implement virtualization on the listbox.
You can either use a VirtualizingStackPanel inside a Listbox as ItemsPanel Template or you use - ItemsControl and set its property VirtualizingStackPanel.IsVirtualizing="True"
This should help.

How can I achieve this layout in WPF C#? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
As you can see in this image:
It's a table containing different controls(e.g. button, list, text) on the columns that can be sorted and each row is unique to each other. Any help or starting point would be greatly appreciated.
You would typically have an Observable Collection which holds the objects of interest (i.e. in your screenshot you have a person with a name, age, etc), so it could potentially be an ObservableCollection of Person objects.
Once you have that, you can build up your view in XAML. Typically you'd have some sort of list control (list view, list box, etc) that binds to the collection, and you create a data template in order to customise the look and feel of the control to match how it looks in the screenshot.

Indenting listview item with icon in c# [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I want to create list view with indented icon and I came across that:
There is a solution, but it's non-dotnet and I was wondering how I could achieve this with C#?
Thanks!
See this MSDN page. Use the IndentCount property of the ListViewItems.
However see the remark there:
The IndentCount property can be used only when the View property of
the containing ListView is set to Details, and the SmallImageList
property of the ListView is set.
The example there works easily.

Categories