Creating a custom control, but I'm no good at them. could someone help out please?
I have a database with filenames and their locations, and to maintain this database I loop through the "locations" and for every location that does exist I loop through thw files in that folder to see if they exist in the database. from this I create a report, but I need this report to have clickable buttons that can trigger actions (like showing a form so enter data for a newly found file), but I dont know how to do that!
What I effectively need to be able to do is to just add rows of "mesage - button" combinations.
The little illustration I have attached should help in explaining what I mean.
I'm not asking someone to write it for me, cos I am trying to learn but if someone could steer me in the correct direction it would be greatly appreciated
If I understand what you're asking then you are wanting to create a UserControl.
Right click on your project in the Solution Explorer and choose Add from the context menu. Add a UserControl.
The UserControl looks like a blank form. Drop a textbox a label and a button on it. You may need to save and rebuild your project now (shouldn't have to, but you may as well...)
Now UserControl1 should be in your toolbox and you can drop as many instances of it as you want anywhere you wish. It is a control like any of the built in ones (buttons, textboxes, etc.) abd behaves the same - you can assign to its properties and handle its events.
Does this help, or have I missed the point?
This world is not my home. I'm just passing through.
You have got the point, but the problem that I cannot figure out is how to effectively have a list of these controle like a generated set of rows of these things.
Like a listbox, but a list of these things, or a single control that does it all. Like, if a file needs to be added to the database, I want a row that shows that a file was found and there is a button on that row that allows you to add it (run a function or any given piece of code in the project).
So, put (say) 12 of these controls on your form and have a pair of up/down scroll buttons next to them. Populate the controls from a list of files. Shuffle the data up and down the 12 controls when the scroll buttons are clicked.
You don't have to go with the up/down scroll buttons - you could use a vertical scroll bar, but its a bit tricky getting the handle sizing right with that.
This world is not my home. I'm just passing through.
now fo someone is kind enough, how would I be able to access functions that are located inside the parent form, from the control ? (I'm a little new to this, so please be tolerant)