custom dynamic user control with event handler C# WinForm
Vložit
- čas přidán 25. 07. 2024
- ☕ Buy me a coffee!
www.buymeacoffee.com/aaricaaiden
📧 Email
aaric.aaiden@gmail.com
🔗 Source Code :
www.buymeacoffee.com/aaricaai...
🔗 Part 2 - With Database :
• Handling dynamic user ...
------------------------------
Track: Lisbon - Ason ID [Audio Library Release]
Music provided by Audio Library Plus
Watch: • Lisbon - Ason ID | Fre...
Free Download / Stream: alplus.io/lisbon
------------------------------
🎵 Track Info:
Title: Lisbon
Artist: Ason ID
Genre: Dance & Electronic
Mood: Calm
---
😊 Contact the Artist:
Ason ID:
/ ason-music
/ asonidoffici. .
open.spotify.com/artist/5WHsT...
/ artist .
deezer.com/us/artist/1496561
/ asonid
/ asonsweden
/ asonid
---
Just found a way to perform a user control click event when click on any control placed on it. Such as button, Labels, & panel etc.
Load this event on UserControl_Load for every control you want to trigger user control click.
For example you want user control to be clicked if you click a label:
YourLabelName.Click += new EventHandler((object sender, EventArgs e) => this.OnClick(e));
Really useful video. Many thanks Aaric!
Glad to hear that. Thanks for watching :)
life saver😆🔥Thank you
The one i have been looking for. Thank you so much.
Anytime.
Thanks for this such a useful code.
Keep on.👍🏻
thank you very much
Thanks, gracias aqui un hispanohablante. . .
Thankyou So Much
que bom, gostei do seu video. parabens.
Can I do like this code if I want to use this user control inside another user control that inside form
Thank you for this video it is so great and clear, I want to see how we can link this project with database
Watch this
czcams.com/video/qa45JdB4ALM/video.html
thank you so much, dear sir, you made my day !
I'm glad you like it 🙂
Hello, I want to know how I can create database like what use in this video
Sir please upload
electronics instrumentation and measurements 2nd edition david a bell solution
hello, I have try this code but there are 3 Error when I start the project It is in
pb_icon. Image = obj.Icon;
lbl_title. Text =obj.Title ;
lbl_subtitle. Text=obj.SubTitle;
the errors says Cannot implicitly convert type 'System.Windows.Forms.PictureBox' to 'System.Drawing.Image' and Cannot implicitly convert type 'System.Windows.Forms.Label' to 'string'
please help me fix this
There is no event handler of User Control so it does not triger the click even..... This code does not work
I do like that code but now it doesn't display the icons , titles and subtitles
Hi man, thanks at frist.
I try this one but when i ry to access to listItems[i] it shows an null reference eception, it seems i cant acces from a UserControl to this Custom UserControl.
It is only possible to acces to the object with a Form and not wiht other UserControl?
The list is empty, as indicated by the NullReferenceException, and in this video, we initialise the list with CustomUserControl objects.
You are most likely missing the following statement:
listItems[i] = new CustomUserControl();
How can I add a new item on button click without using SQL Database?
First, you should go through the link below.
stackoverflow.com/a/2607043
and for the images you can keep the paths stored as string along with the data. and when fill values to usercontrols you can get the image using path.
As below :
Image.FromFile(imagePathHere)
hello brother, is it possible to get the value when we click the picturebox, not the usercontrol?
Brother navigate to "Yunis Maruf" conversation. i have already provided solution for this.
@@AaricAaiden thank you so much!
Using database video please sir
czcams.com/video/qa45JdB4ALM/video.html
Hi sir i need help about user control how to change label text in dynamically created user control
I have created getter and setter in user control class if you see.
Those getter and setter are used to get and set values to labels placed on a user control.
To set text to label on each dynamic user control. I have created a function (generateDynamicUsercontrol) in this function. You will see the labels text is being initialized.
And to get labels text I have used user control object to access getter and setter of a class inside a dynamically created click event.
Watch video completely you will understand it better. I have also commented every statement in a code.
and How i populate labels with SQL database? Please help me
Thanks for asking. I will soon upload a tutorial.
Video Uploaded !
czcams.com/video/qa45JdB4ALM/video.html
Hi, I have try this code but there are 3 Error when I start the project
It is in
pb_icon. Image = value;
lbl_title. Image =value ;
lbl_subtitle. Image=value;
The Errors are because the names 'pb_icon', 'lbl_title' and 'lbl_subtitle' don't exist in the current context
I just want to know how I can fix it
Rename PictureBox to pb_icon in properties tab.
Label that you are using for title rename to lbl_title
and lbl_subtitle for sub title label
@@AaricAaiden
I do that and it is works But pictures ,title and subtitle don't display.
Maybe because I use this user control insaid another user control
Hello!, i have exactly the same problem, it is because we use this UserControl in another UserControl?
I am having an error it shows Object reference not set to an instance of an object.
Email me,
aaric.aaiden@gmail.com
What is this message?Corrupt .resource file. unable to read resource from this file Because of invalid Header information. try regenerating the .resource file help Me please
Email me
aaric.aaiden@gmail.com
I want to add click event to panel , how can do it?
If you want that when you click panel. It should perform same as on user control click.
here is a solution for this:
YourPanelName.Click +=new EventHandler(( object sender, EventArgs e) => this.OnClick(e));
Paste this line of code in your user control load event.
For explanation watch this video
czcams.com/video/dlYpP6wi7RY/video.html
from
3:37 - 3:54
@@AaricAaiden thanks for your support,
I will try it.
@@yunismaruf Anytime.
@@AaricAaiden THANKS it's worked.
@@AaricAaiden thanks it’s worked
Event Handler doesn't work on user control Controls like click on label it doesn't work
If you want that when you click label. It should perform same as on user control click.
here is a solution for this:
YourLabelName. Click +=new
EventHandler(( object sender, EventArgs e) =>
this.OnClick(e));
Paste this line of code in your user control load
event.
For explanation watch this video
czcams.com/video/dlYpP6wi7RY/video.html
from
3:37 to 3:54
thanks a lot really helpful, if u just could send me the code
Sure, provide me your email address.
@@AaricAaiden Also if u could make a video on how to customize datagridview with usercontrol
@@GrenneAnGel Sure, Could you provide briefing about what exactly you want to do. So that i can show exact same. instead coding sample.
@@AaricAaiden i dropped my email address in a reply before. Send me an email and imma send you more details about usercontrol datagridview
@@GrenneAnGel You can check your email.
No dynamic
I do like that code but now it doesn't display the icons , titles and subtitles
I use this user control inside another user control
Is that didn't let the icons, titles and subtitles display