i have created listbox. i inserted many items so listbox have scroll bar and also i put drag over event for drag up and drag down item. now my problem is that if i have multiple item and listbox display in scroll view than how to scroll up and scroll down my item in large set of item in listbox. please provide me solution. thanks in advance...
drag up and drag down item in many item in listbox in winforms c#
378 Views Asked by MoonTech At
2
There are 2 best solutions below
0
Jonathan Applebaum
On
I think that FlowLayoutPanel (or TableLayoutPanel ) can be suitable for that need,
here is a basic example, comments inside the code:
private void Form1_Load(object sender, EventArgs e)
{
// declare flowlayout panel
FlowLayoutPanel fl = new FlowLayoutPanel();
fl.Size = new Size(500, 800);
// this will add a scroll bar when the children height are greater than the height
fl.AutoScroll = true;
this.Controls.Add(fl);
// add pictureboxes that shows the bitmaps
for (int i = 0; i < 20; i++)
{
Bitmap b = new Bitmap(@"C:\Users\xxx\xxx\xxx.png");
PictureBox p = new PictureBox();
p.Image = b;
p.Size = new Size(fl.Width, 50);
fl.Controls.Add(p);
}
}
Related Questions in C#
- How to call a C language function from x86 assembly code?
- What does: "char *argv[]" mean?
- User input sanitization program, which takes a specific amount of arguments and passes the execution to a bash script
- How to crop a BMP image in half using C
- How can I get the difference in minutes between two dates and hours?
- Why will this code compile although it defines two variables with the same name?
- Compiling eBPF program in Docker fails due to missing '__u64' type
- Why can't I use the file pointer after the first read attempt fails?
- #include Header files in C with definition too
- OpenCV2 on CLion
- What is causing the store latency in this program?
- How to refer to the filepath of test data in test sourcecode?
- 9 Digit Addresses in Hexadecimal System in MacOS
- My server TCP doesn't receive messages from the client in C
- Printing the characters obtained from the array s using printf?
Related Questions in WINFORMS
- Musical chairs: How can an asynchronous task cancel a synchronous one in c#?
- TCP Client Losing Connection When Writing Data
- how check if printing content on new page
- Find what is writing to the Output window
- WinForms, event unable to subscribe from a custom class
- A cleaner way to approach the given output
- Working with panel and moving from the second form to the the panel
- Accurately placing multiple controls in a row programmatically with dynamic table layout panel
- How to find winform application in visual studio 2022?
- How to stop comments being included in C# release build .exe
- Why is the Blazor value not immediately being rendered after changing it?
- .NET 6 Winforms separate forms control pop up freezing when unfocused and using native Windows file transfer pop up
- How to Fix C# WinForms Application Not Loading correctly on Windows 11?
- Visual Studio edit view corrupt for xaml and Winforms design views
- How to solve the problem that dragged column in datagridview too slow or miss when AllowUserToOrderColumns = true
Related Questions in DRAG-AND-DROP
- React Grid Drag n Drop
- In SwiftUI and macOS how do I copy-and-paste and drag and drop multiple local file URLs into a scroll view
- need an function swap for swaping elements
- How to keep drag preview exactly the same as original item?
- How can I configure Angular Material drag and drop to allow dropping an element when the cursor is outside the drop zone
- can't drag boxes to specific time slot in weekly calendar
- How to create a function on reordering the project views using Cypress automation
- SwiftUI - List multi selection move / reorder (works on Mac but not on iOS)
- OnBeginDrag does not get called when a nested Canvas is attached in Unity UI
- Block file opening when drag and drop
- Drag&Drop feature in jquery drops element at seemingly random position
- Cannot drag boxes in calendar weekly column
- How drag and drop 2D UI elements of Canvas in OVR ray interactable?
- How to appendchild() using drag drop with 2 hierarchically equal divs? using Typescript
- Is it possible to change the cursor while dragging using HTML drag and drop
Related Questions in LISTBOXITEMS
- How to make data in the listbox appear line-by-line since listbox doesn't take "\n"?
- drag up and drag down item in many item in listbox in winforms c#
- Keeping ListBox selections in session on a postback
- How to set items check in checklistbox?
- How to use a double click event to click text in a listbox to make that text appear in a empty textbox
- Delete items from a llist box in c# through if and else
- Drag&Drop between two/more WPF listboxes
- How can I add the value of an item in a list box to a local variable in C#?
- Sort Userform ListBox
- How to click nth element from listbox of Google autocomplete suggestion using Protractor?
- Change highlight color of combobox item WPF
- Copy/Save PyQt5 Listbox items in a text file python
- C# - Editing Listbox Items
- how to iterate through a listbox selected items and get ValueMember and Display Member
- Issue Preventing Duplicates from Being Added to a Listbox When Listbox Contains Items Loaded from a Save File
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
To Do that you need to override OnDrawItem ex : https://www.codeproject.com/Articles/2091/ListBox-with-Icons
Or you can use different controls as
DataGridVieworListViewex:How do add image to System.Windows.Forms.ListBox?