C# Tutorial - Dynamically Loading User Control | FoxLearn

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 พ.ย. 2024
  • Create and Use User Control, load user control dynamically in c#. This is the best way to learn c# for beginners

ความคิดเห็น • 103

  • @usman6894
    @usman6894 4 ปีที่แล้ว

    I appreciated your lecture and felt as if you were speaking directly to me.

  • @nuubgenius7455
    @nuubgenius7455 6 ปีที่แล้ว

    It takes me how many hours to search through the internet, and finally found the solution. Thank you !

  • @darko-petrovic
    @darko-petrovic 8 ปีที่แล้ว +13

    Simple, quick, efficient - excellent!

    • @foxlearn
      @foxlearn  8 ปีที่แล้ว +1

      Thank you so much :)

    • @alpaydavran5892
      @alpaydavran5892 4 ปีที่แล้ว

      @@foxlearn Hello! please write for me email davranalpay@gmail.com
      Thanks!!

  • @xbxb
    @xbxb ปีที่แล้ว

    this is much better than dragging all the usercontrol to a mainform the using bring front?

  • @mohammadnematollahi717
    @mohammadnematollahi717 2 ปีที่แล้ว

    It helped me a lot Thanks Thanks Thanks Thanks

  • @carloregidor926
    @carloregidor926 7 ปีที่แล้ว +1

    Very helpful and efficient! :) Thanks!

  • @HirenModi
    @HirenModi 6 ปีที่แล้ว +1

    Simply Superb, just amazing!!!

    • @foxlearn
      @foxlearn  6 ปีที่แล้ว

      Thank you !

  • @MDANWARJAHID
    @MDANWARJAHID 6 ปีที่แล้ว +1

    Thank you .. Simple and use full , efficient

    • @foxlearn
      @foxlearn  6 ปีที่แล้ว

      Thank you !

  • @kurdishprogramming4698
    @kurdishprogramming4698 2 ปีที่แล้ว

    Good💐💐💐

  • @fredflintstone8048
    @fredflintstone8048 8 ปีที่แล้ว

    Great video. Thanks. I used this technique in my current project. I have split view in my main form and have a tree view on the left, and a number of these user controls on the left.
    I was able to add a static event handler in the User Control that allows me to trigger a method in my main form in order to update the TreeView from the User Control when making changes. That works nicely.
    The trouble I'm having is trying to go the other direction and that is to affect graphics objects like textBoxes, and txtLabels in my User Control form from the main form. It's easy enough to create and execute static methods and change static properties from the main form in the user control, but bridging the gap to the non static elements of the User control seems to elude me.
    My goal is to be able to click in the Treeview and have graphics objects updates in the User control. At present I'm calling a static method that updates static local variables in the User control, and then having to click a button on the user control to load those changes. I would love it to be automatic. I've found a number of suggestions on the web for how to do this, but none of them seem clear. I quickly scanned through your videos to see if you address this, and found nothing. If you have addressed this I would really appreciate a link. Again, thank you for sharing your knowledge.

    • @foxlearn
      @foxlearn  8 ปีที่แล้ว

      Hi, You can call the method invalidate or validate to redraw your control, please try again. thank you so much

  • @shabansaad8171
    @shabansaad8171 4 ปีที่แล้ว

    How add event to usercontrol
    For example whent dubile click pass data from usercontrol to form

  • @1986nesha
    @1986nesha 8 ปีที่แล้ว +2

    This is what i have been looking for, BUT: There is no Panel in WPF, there is DockPanel,WrapPanel,ToolBarPanel,Grid and Canvas. Which do I use and how exactly i assign a module to it?
    Thanks!

    • @foxlearn
      @foxlearn  8 ปีที่แล้ว

      +1986nesha Hi, You can use Canvas. Reference msdn.microsoft.com/en-us/library/ms754152(v=vs.100).aspx . Thanks

    • @TheUofastudent
      @TheUofastudent 5 ปีที่แล้ว

      @Cham2Too i have the same problem have you found a solution ?

  • @dhanyel2439
    @dhanyel2439 7 ปีที่แล้ว

    Graciass de graciasss!! .. por este compartir de video tutorial 😃

  • @anjeloxd7883
    @anjeloxd7883 8 ปีที่แล้ว

    Great tutorial! One question.I want to have a button inside the usercontrol1 that functions as exit the usercontrol. What is the code for that?

    • @foxlearn
      @foxlearn  8 ปีที่แล้ว

      Hi, You can add button, more controls to the user control. thanks

  • @sonatahd9877
    @sonatahd9877 3 ปีที่แล้ว +1

    thanks for tut

  • @alevpirr4600
    @alevpirr4600 8 ปีที่แล้ว +1

    Isn't this just stacking up the forms on top of each other? If yes, what's the best way to dispose them?

    • @foxlearn
      @foxlearn  8 ปีที่แล้ว +1

      You can remove them from panel, then call Dispose method. thanks

  • @sonamu3627
    @sonamu3627 3 ปีที่แล้ว

    시청 완료

  • @SpecterPt
    @SpecterPt 7 ปีที่แล้ว

    Do you have written commentary about this code?

  • @venumanikonda5562
    @venumanikonda5562 ปีที่แล้ว

    Hello Fox Learn can you please possible upload this code here?

  • @downfall991
    @downfall991 5 ปีที่แล้ว

    Hi, this works great! Thank you so much!
    However I tried using this method to add a user Control to a user control. But it didnt work... Is there a way to do this??

    • @foxlearn
      @foxlearn  5 ปีที่แล้ว

      You should add a panel to the usercontrol, then you can add the usercontrol to the panel

  • @stratoschatziioannou
    @stratoschatziioannou 4 ปีที่แล้ว

    Hi, May I ask you? I am trying to use two user control. Though, I accomplished to transfer from the first one to the second, I cannot hide the first one. Any ideas?

    • @foxlearn
      @foxlearn  4 ปีที่แล้ว

      You should use panel, then send your control to back

  • @containerflex
    @containerflex 6 ปีที่แล้ว

    THANK YOU FOR THIS TUTORIAL IT HELPS ME ALOT GODBLESS AND STAY UPLOADING VIDEO TUTORIALSS

    • @foxlearn
      @foxlearn  6 ปีที่แล้ว +1

      Thank you so much !

    • @containerflex
      @containerflex 6 ปีที่แล้ว

      how to fill datagridview in FORM 1 from custom user control?????

  • @tiarakp2202
    @tiarakp2202 4 ปีที่แล้ว

    how can I pass value from one user control to another user control?

  • @abraofrancisco7198
    @abraofrancisco7198 7 ปีที่แล้ว

    Hi Fox Learn
    Could you help creating an video on how to create tabcontrol based on tables from database. Pls
    Ex. Category(tab,), subcategory (suntan) then products. Please

  • @oe5720
    @oe5720 5 ปีที่แล้ว

    Thank you so much for this.
    However, I'm having some errors - get: not all code path return a value.

    • @foxlearn
      @foxlearn  5 ปีที่แล้ว

      Please check your code again. i think you miss something

    • @MetinTuncer
      @MetinTuncer 5 ปีที่แล้ว

      @@foxlearn same problem i have. get missing

  • @michaelmaina1
    @michaelmaina1 5 ปีที่แล้ว

    hello fox learn?.
    Nice tutorial..
    i have a question.
    how do i set the _instance to null again..
    i mean how do i initialize the ucmodule1 so that _instance is null..
    Thank you!..

    • @foxlearn
      @foxlearn  5 ปีที่แล้ว +1

      _instance = null;

    • @michaelmaina1
      @michaelmaina1 5 ปีที่แล้ว

      @@foxlearn thanks alot
      hope one day you will make a video on how to save a datatable in a dataset to a database...

  • @muhammadfawad6970
    @muhammadfawad6970 7 ปีที่แล้ว

    First I received data from one user control to another when I add but second time, I can 't receive data when I add? How to receive data second time by adding ?

  • @usama57926
    @usama57926 6 ปีที่แล้ว +1

    please make video on nested user control

    • @foxlearn
      @foxlearn  6 ปีที่แล้ว

      Ok. Thank you for your suggestion

  • @MetinTuncer
    @MetinTuncer 5 ปีที่แล้ว +1

    i have a problem "" get: not all code path return a value"" i m using VS 2019

    • @foxlearn
      @foxlearn  5 ปีที่แล้ว

      Please check your code again. i think you miss something

  • @EHPADservice
    @EHPADservice 8 ปีที่แล้ว

    hai! usercontrol has buttons when click button, how to display another user control inl same pannel and go back or remove?

    • @foxlearn
      @foxlearn  8 ปีที่แล้ว

      Hi, You can add another usercontrol to the panel, then set the usercontrol is bring to front control. thanks

    • @EHPADservice
      @EHPADservice 8 ปีที่แล้ว

      Fox Learn hi imagine i has 3 user control eg 1,2,3 each one has button to bring to front. now user control 1 has two buttons when i click on it user control 4 must be bring to front. how can do this? and i have button as back when i click on it viewed user controls should be appear. how do it.

  • @andreppp97
    @andreppp97 6 ปีที่แล้ว

    Can this method be used at Visual Basic ?

    • @foxlearn
      @foxlearn  6 ปีที่แล้ว

      Yes, You can do. I'll upload tutorials for vb.net soon

  • @Allinone-bx1be
    @Allinone-bx1be 4 ปีที่แล้ว

    Thanks very much :)

  • @AnhNguyen-kb7fz
    @AnhNguyen-kb7fz 6 ปีที่แล้ว

    thank you very helpful!!!

    • @foxlearn
      @foxlearn  5 ปีที่แล้ว +1

      Thank you !

  • @tomokachanai3060
    @tomokachanai3060 8 ปีที่แล้ว

    How to pass the values from form to User control by using those instances?

    • @foxlearn
      @foxlearn  8 ปีที่แล้ว

      +TomokaChan Ai Hi, You can define the properties in UserControl. Thank you

    • @tomokachanai3060
      @tomokachanai3060 8 ปีที่แล้ว

      +Fox Learn Thanks! :)

  • @khanhtuongtranlam9141
    @khanhtuongtranlam9141 6 ปีที่แล้ว

    I want send data from form to user control ? How do that ? Thanks

    • @foxlearn
      @foxlearn  6 ปีที่แล้ว

      Thank you for your suggestion. I'll upload the tutorial as soon as possible

  • @pinaplehits
    @pinaplehits 5 ปีที่แล้ว

    You can improve your code like this:
    public static ucModule1 Instance => _instance ?? (_instance = new ucModule1());

    • @foxlearn
      @foxlearn  5 ปีที่แล้ว

      Thank you !

  • @homeyasamal8474
    @homeyasamal8474 5 ปีที่แล้ว

    Good

    • @foxlearn
      @foxlearn  5 ปีที่แล้ว +1

      Thank you !

  • @chauhanbhavika3276
    @chauhanbhavika3276 6 ปีที่แล้ว +1

    Thanks

  • @thunderbolt997
    @thunderbolt997 8 ปีที่แล้ว

    i have user control inside of form1
    how would i do if i have a user control and in its code i have an integer and would want to make an item in the main window ex form1 become invisible when integer or string is
    my desired value?
    i cant seem to get the integer from user control into the form1 window... :/
    i have a user control that has username and password and then in form1 when
    username and password is wright it reveals form1's items (visible = true)

    • @foxlearn
      @foxlearn  8 ปีที่แล้ว

      +THUNDERBOLT Hi, You can use properties to get value from user control. You can view this video th-cam.com/video/6nqn9AAfoZQ/w-d-xo.html. Similar for the user control. Thank you !

  • @naimur634
    @naimur634 4 ปีที่แล้ว

    How can I pass values from user control to form

    • @foxlearn
      @foxlearn  4 ปีที่แล้ว

      OK. Thank you for your suggestion. I'll upload soon !

  • @leno9565
    @leno9565 7 ปีที่แล้ว

    Please come down to us from the video tutorial for (text-to-speech )

    • @foxlearn
      @foxlearn  7 ปีที่แล้ว +1

      Thank you

  • @NacionCodigo
    @NacionCodigo 5 ปีที่แล้ว

    Good Job!, thanks

    • @foxlearn
      @foxlearn  5 ปีที่แล้ว

      You're welcome. Thank you !

  • @DS-tc7uu
    @DS-tc7uu 8 ปีที่แล้ว

    Hi can you make e Tutorial where you Load a Xml File which contains Controls in this Xml and your create this UI after read the xml file?
    1. step read xml which contains controls
    2. step generate UI whit this xml file
    Thank you!

    • @foxlearn
      @foxlearn  8 ปีที่แล้ว +1

      OK. Thank you for your suggestion. I'll make soon

    • @DS-tc7uu
      @DS-tc7uu 8 ปีที่แล้ว

      Fox Learn You can maybe read this xml and generate a combobox with his values. i think this a very good example. Thank you so much.

    • @harshadonline4u
      @harshadonline4u 7 ปีที่แล้ว

      have you prepare this video? if yes please send me link

  • @gren8759
    @gren8759 6 ปีที่แล้ว

    Very helpfull

    • @foxlearn
      @foxlearn  6 ปีที่แล้ว

      Thank you !

  • @abdulsami1982
    @abdulsami1982 6 ปีที่แล้ว

    where would be its practical implementation in real life application?

  • @spang1e858
    @spang1e858 7 ปีที่แล้ว

    Thanks very much

  • @generalg657
    @generalg657 6 ปีที่แล้ว

    thank you so much!

    • @foxlearn
      @foxlearn  6 ปีที่แล้ว

      You're welcome & Thank you !

  • @usama57926
    @usama57926 6 ปีที่แล้ว +1

    thank u mam

    • @foxlearn
      @foxlearn  6 ปีที่แล้ว

      Thank you !

  • @Sidle9
    @Sidle9 7 ปีที่แล้ว

    {Thank you so much!!!! :)}

    • @foxlearn
      @foxlearn  7 ปีที่แล้ว

      Thank you :)

  • @Hmoobtwjcuabchanel
    @Hmoobtwjcuabchanel 8 ปีที่แล้ว

    how about vb code sir hope you can give me some examples

    • @foxlearn
      @foxlearn  8 ปีที่แล้ว

      Thank you for your suggestion. I'll make the tutorial with vb.net soon :)

  • @rjunboxing7255
    @rjunboxing7255 7 ปีที่แล้ว

    thank bro

  • @harunturan772
    @harunturan772 7 ปีที่แล้ว

    Great explain thank you very much beautiful girl :D

    • @foxlearn
      @foxlearn  7 ปีที่แล้ว

      Thank you so much :)

  • @miguelguerrero4262
    @miguelguerrero4262 6 ปีที่แล้ว

    Desing Patron Singlenton

  • @MetinTuncer
    @MetinTuncer 5 ปีที่แล้ว

    public static UcTma Instance
    {
    get
    {
    if (_instance == null)
    {
    _instance = new UcTma();
    return _instance;
    }
    else
    {
    return _instance;
    }
    }
    }
    vill be like this :D

    • @foxlearn
      @foxlearn  5 ปีที่แล้ว

      Thank you !

  • @kirillprohorenko8356
    @kirillprohorenko8356 6 ปีที่แล้ว +1

    заебись, спс

  • @LourdClash
    @LourdClash 11 หลายเดือนก่อน

    bro it's not working

  • @lighton9451
    @lighton9451 ปีที่แล้ว

    xd

  • @LourdClash
    @LourdClash 11 หลายเดือนก่อน

    you lie