How to Drag and Resize border-less Winform Application C#

Sdílet
Vložit
  • čas přidán 7. 09. 2024
  • Hi Friends, This is SaLaaR HuSyN, Coming back with another Video Tutorial. in this very quick tutorial we'll learn how to Drag and resize a windows form with boder style "None"....
    This Video will be helpful for Some of you Guys..... :)
    Reference:
    stackoverflow Post with same Title... :)
    Download Source Code:
    github.com/SaL...
    ++++++++++++++++++++++++++++++++++++++++++++
    For Android Ui Tutorials, Please Subscribe Our Channel Android Ui Academy:
    / @androiduiacademy6689
    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    if You Have any Query, feel free to contact Us on Facebook:
    / csharpuiacademy
    ++++++++++++++++++++++++++++++++++++++++++++
    Please Subscribe for more Videos.

Komentáře • 109

  • @balasenk
    @balasenk Před 6 lety +13

    Hello team, am the fan of you guys, every video's is interesting and design is awesome,. Thanks.

  • @leobarbosa173
    @leobarbosa173 Před 6 lety +5

    I'm from Brazil, Rio de Janeiro, I really enjoy these tutorials :):):)

  • @semosemo3827
    @semosemo3827 Před 4 lety +13

    private const int cGrip = 16;
    private const int cCaption = 32;
    protected override void WndProc(ref Message m)
    {
    if (m.Msg == 0x84)
    {
    Point pos = new Point(m.LParam.ToInt32());
    pos = this.PointToClient(pos);
    if (pos.Y < cCaption)
    {
    m.Result = (IntPtr)2;
    return;
    }
    if (pos.X >= this.ClientSize.Width - cGrip && pos.Y >= this.ClientSize.Height - cGrip)
    {
    m.Result = (IntPtr)17;
    return;
    }
    }
    base.WndProc(ref m);
    }

  • @user-tn3bw1wg8w
    @user-tn3bw1wg8w Před 6 lety +9

    Спасибо большое, за ваши видео уроки!))

    • @CUiAcademy
      @CUiAcademy  Před 6 lety +7

      Спасибо, что посмотрели мои видео. :) :)

  • @roul3688
    @roul3688 Před 5 lety +4

    You are the man/woman! Thanks for this!

  • @aylakhan4699
    @aylakhan4699 Před 6 lety +2

    i like your all tutorials very much .i also share this video's with my friends this is really very very best tutorial and also good work brother ..

    • @brazo98
      @brazo98 Před 6 lety

      perfect thx a lot kindly regards

  • @smsoorganization292
    @smsoorganization292 Před 6 lety +2

    hey i like your tutorials thank you and Jazakalahu khayr

  • @warmice8265
    @warmice8265 Před 4 lety +3

    Can I resize the form without using Bunifu ?
    Thanks.
    P.S. : Great video !!!

  • @user-xu9rz7he2i
    @user-xu9rz7he2i Před 3 lety +1

    I comment here to let you know that one more Vietnamese person knows you :v.

  • @essouaiedameur7642
    @essouaiedameur7642 Před 3 lety +1

    how can I add the bunifu package to my VS2019

  • @xheptc9612
    @xheptc9612 Před 5 lety +1

    We create, We Design, We develop.

  • @softmetric6140
    @softmetric6140 Před 4 lety

    Designing is ok, but we want the back-end. Because we want to develop more beautiful + functional applications.

  • @TheAceAdventures3
    @TheAceAdventures3 Před 5 lety +2

    Perfect ! Thanks Dude ! From 2019

  • @neilluck1759
    @neilluck1759 Před rokem

    I hover my mouse over the form edges, but when I click, the edge doesn't grab and resize. Is there a fix for this?

  • @darius8171
    @darius8171 Před 6 lety +3

    Hey, thank you for tutorial. But could you tell how to resize windows until some specific size? For example: resize it till width=500 and height=700
    (Try to resize Skype. It allows you to resize until specific size)

    • @CUiAcademy
      @CUiAcademy  Před 6 lety +2

      Hi @Darius... Thanks for watching my Videos.... Select your form and go to properties and here you'll find "Max Size" and "Min Size" property.... just put the minimum or maximum size according to your Requirement...... :) :)

    • @darius8171
      @darius8171 Před 6 lety +1

      Thank you!

    • @LucifiedPower
      @LucifiedPower Před 2 lety

      @@darius8171 can you give me the code

  • @SeekersforSeekers
    @SeekersforSeekers Před 5 lety +1

    i watched ur first video..this one and subscribe ur channel..

  • @AaricAaiden
    @AaricAaiden Před 6 lety

    If you make the video on how to create a responsive application. it would be great. I want to create a responsive application in c# just like other softwares are responsive but i couldn't. i have watched many tutorials on CZcams but nothing worked exactly same as i want.

  • @ralphipeyrna6989
    @ralphipeyrna6989 Před 6 lety +1

    i need it but with ismdicontainer active in the form, is this possible?

  • @squad-failure
    @squad-failure Před 4 lety

    I cannot implement this into my program, i don't know why isn't working, not throwing any errors but doesn't let it's self resize, and i did everything right from the tutorial... I removed my old code and tried with a brand new one, still not working...

  • @Hamiscool
    @Hamiscool Před 3 lety

    When I resize my form, none of the content inside it changes size; just position. Any ideas?
    Nevermind, I just figured out that if you change the anchor of all of the content to "Top, Bottom, Left, Right" it works.

  • @carlmarionmanlapaz4697

    very informative. subscribed.

  • @manjeetnandal1
    @manjeetnandal1 Před 4 lety +1

    But lack of source codes!
    Anyway, great sharing!
    Great thanks!

  • @ZEkA10000
    @ZEkA10000 Před měsícem

    Okay, to use that thing you need to buy that...

  • @imamhossain1818
    @imamhossain1818 Před 5 lety +2

    Thank you sir

  • @leftofzen
    @leftofzen Před 5 lety

    Yeah...try and resize the form via the top of the window using this technique. Goodluck ;) (It's possible but requires some more trickery than presented in this video)

  • @technologyknowledge5004
    @technologyknowledge5004 Před 2 lety +1

    Hello sir please make a video on
    "how to drag and resize borderless winform in powershell studio"

  • @mariokiric
    @mariokiric Před 6 lety +3

    Very helpful tutorial! But my problem is, how I resize border-less Winforms in VB (Visual Basic) and not in C#, because there is no tutorial, how to do it :(
    Greetings from Germany!

    • @brazo98
      @brazo98 Před 6 lety +2

      Const WM_NCHITTEST As Integer = &H84
      Const HTCLIENT As Integer = &H1
      Const HTCAPTION As Integer = &H2
      Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
      Select Case m.Msg
      Case WM_NCHITTEST
      MyBase.WndProc(m)
      If m.Result = HTCLIENT Then m.Result = HTCAPTION
      Case Else
      MyBase.WndProc(m)
      End Select
      End Sub
      LG aus BRD

    • @brazo98
      @brazo98 Před 6 lety +1

      Und er hat die DLL mit eingefügt heisst Bunidragcontrol. Da fallen dann Lizenzgebühren an wenn das nutzen willst.

    • @mariokiric
      @mariokiric Před 6 lety

      Brazo Ok, Vielen Vielen Dank! :D Wie sollte es dann aussehen ohne der DLL? Bin kompletter Anfänger ;)

    • @brazo98
      @brazo98 Před 6 lety +1

      Hier wirst du fündig das funktioniert tadellos: www.vbforums.com/showthread.php?568015-Move-and-Resize-a-Control-or-a-Borderless-Form-using-window-messages-(smooth!)

    • @mariokiric
      @mariokiric Před 6 lety

      Brazo Danke ;)

  • @wakcy
    @wakcy Před 4 lety +2

    private const int cGrip = 16;
    private const int cCaption = 32;
    protected override void WndProc(ref Message m)
    {
    if (m.Msg == 0x84)
    {
    Point pos = new Point(m.LParam.ToInt32());
    pos = this.PointToClient(pos);
    if (pos.Y < cCaption)
    {
    m.Result = (IntPtr)2;
    return;
    }
    if (pos.X >= this.ClientSize.Width - cGrip && pos.Y >= this.ClientSize.Height - cGrip)
    {
    m.Result = (IntPtr)17;
    return;
    }
    }

  • @zayantorres4523
    @zayantorres4523 Před 5 lety +1

    Hi, idk if you will answer but how can I like, not resize it, but make drag Form1 around with the FormBorderStyle in **None**? with the mouse

    • @CUiAcademy
      @CUiAcademy  Před 5 lety

      Hi Z-Man... Pleaee watch my this video to learn how to create your own drag control in C# czcams.com/video/SXZN95pU_s0/video.html

  • @alphacentauri6343
    @alphacentauri6343 Před 6 lety +1

    like before i watch

  • @mnlfrk
    @mnlfrk Před 6 lety +1

    Fantastic

  • @seikosantana2313
    @seikosantana2313 Před rokem

    Nice! Can it maximize when being pulled to top of desktop?

  • @ayushpramanik808
    @ayushpramanik808 Před 3 lety

    How do we make the window bigger?, we can only make the window smaller

  • @TesearBlogspot
    @TesearBlogspot Před 4 lety

    Why isn't working if the panel is dock=fill

  • @yokozuna021
    @yokozuna021 Před 4 lety +1

    Thank you so much!

  • @heko9122
    @heko9122 Před 4 lety

    how to resize when a panel or control with Dock = Fill on the form?

  • @zeeshanmushtaq7039
    @zeeshanmushtaq7039 Před 2 lety

    if (pos.X >= this.ClientSize.Width = cGrap && pos.Y >= this.ClientSize.Height = cGrip)
    in this if condition .... error ata ha
    error : The left-hand side of an assignment must be a variable, property or indexer
    please help

    • @CUiAcademy
      @CUiAcademy  Před 2 lety

      ClientSize.Width - cGrip and Height - cGrip.
      Its minus there after width and height, not equal sign.
      I hope it will fix your problem.. 🙂

  • @Thepostroun
    @Thepostroun Před 3 lety

    thanks this video is so greaat!

  • @mohammadahsan5655
    @mohammadahsan5655 Před 3 lety +1

    Form is not resizing, whats the problem ?

    • @CUiAcademy
      @CUiAcademy  Před 3 lety

      Please make sure you've added the line of code in the constructor of form i-e this.SetStyle(....

    • @mohammadahsan5655
      @mohammadahsan5655 Před 3 lety +1

      @@CUiAcademy Yes I have added. I am trying this from at least 2 days, mid and night. But its not working. I have watched many videos and copy paste the google code but no relief.
      Please can you share this form code in complete working condition. ????

    • @CUiAcademy
      @CUiAcademy  Před 3 lety

      @@mohammadahsan5655 please share you piece of code to salaarhusyn@gmail.com I will review it

    • @mohammadahsan5655
      @mohammadahsan5655 Před 3 lety

      @@CUiAcademy I am sharing the complete form

    • @mohammadahsan5655
      @mohammadahsan5655 Před 3 lety

      @@CUiAcademy I have send you the form by mohammadahsanissb.pk.2020@gmail.com Please resolve the issue.

  • @manjeetnandal1
    @manjeetnandal1 Před 4 lety

    Many useful!
    Many thanks!

  • @ezequiasrocha3037
    @ezequiasrocha3037 Před 4 lety

    The download isn't available anymore.

  • @FanmadesMv
    @FanmadesMv Před 4 lety

    Magic number shit form stack overflow... not really what i was searching for but thanks anyway

  • @nesyta1749
    @nesyta1749 Před 6 lety

    How can you do that so that you can move these windows to MDIParent?

  • @Thepostroun
    @Thepostroun Před 3 lety

    nice

  • @mrsterbenblack9270
    @mrsterbenblack9270 Před 6 lety +1

    great work!

  • @vac416
    @vac416 Před 5 lety

    Почему когда я ввожу в toolbox "drag", то у меня нет результатов?

  • @Sixthflyer
    @Sixthflyer Před 6 lety +1

    Well done!

  • @enessolmaz9548
    @enessolmaz9548 Před 3 lety

    Thanks bro 😊❤️

  • @jhwils
    @jhwils Před 5 lety +3

    The Link for source code is dead😰

    • @CUiAcademy
      @CUiAcademy  Před 5 lety +1

      Please download it from my github profile.... Link is given in the description of my other videos...

    • @matejpesl1
      @matejpesl1 Před 3 lety

      @@CUiAcademy You don't have the project on your github profile.

  • @agusd3327
    @agusd3327 Před 4 lety

    thank you very much

  • @lephonghaiful
    @lephonghaiful Před 4 lety

    link dowload is dead, please refresh it.

  • @abdalahali6746
    @abdalahali6746 Před 5 lety

    link to download source code dosent work plz any one have downloaded it send here thank you

  • @TERIHAX
    @TERIHAX Před 4 lety

    it's not working for me.

  • @ethanhill2016
    @ethanhill2016 Před 4 lety

    I am able to resize it but my content is not affected, how do i make it so the content is pushed?

    • @CUiAcademy
      @CUiAcademy  Před 4 lety +1

      Select your controls, go to properties and set Anchor property to None..
      I hope it will work for you... :)

    • @ethanhill2016
      @ethanhill2016 Před 4 lety

      C# Ui Academy ok I have done that but now my label over laps my head panel after I resize it too small

    • @CUiAcademy
      @CUiAcademy  Před 4 lety +1

      @@ethanhill2016 Select your form, go to properties and set a Minimum Size for your Form.

  • @korichiTarzi
    @korichiTarzi Před 6 lety +1

    good

  • @kyleb3316
    @kyleb3316 Před 2 lety

    my eyesssssss >.

  • @z0rd.154
    @z0rd.154 Před 4 lety

    Можете дать ссылку на вашу программу на гитхабе? не как не могу найти :(

  • @hiddenhidden6340
    @hiddenhidden6340 Před 4 lety

    Hi sir please consider to prepare your designs first and then make a tutorial,
    Your half video is an advertisement.

  • @mohammadahsan5655
    @mohammadahsan5655 Před 3 lety

    Bhai yr bta do, mai b Pakistan sy hnn

  • @zeeshanmushtaq7039
    @zeeshanmushtaq7039 Před 2 lety

    😪please helpme

  • @kyrollosemad5319
    @kyrollosemad5319 Před 5 lety

    can you mae a tutorial in vb.net please

  • @erithia--51
    @erithia--51 Před 3 lety

    tysm

  • @pedrohenriwue6327
    @pedrohenriwue6327 Před 6 lety +1

    must have Buniffu?

    • @CUiAcademy
      @CUiAcademy  Před 6 lety +4

      No, if you don't have the Bunifu file just remove the header panel from Ui and add this event method after Constructor,
      protected override void OnPaint(PaintEventArgs e) {
      Rectangle rc = new Rectangle(this.ClientSize.Width - cGrip, this.ClientSize.Height - cGrip, cGrip, cGrip);
      ControlPaint.DrawSizeGrip(e.Graphics, this.BackColor, rc);
      rc = new Rectangle(0, 0, this.ClientSize.Width, cCaption);
      e.Graphics.FillRectangle(Brushes.DarkBlue, rc);
      }

    • @pedrohenriwue6327
      @pedrohenriwue6327 Před 6 lety

      Thanks

  • @MuhammadAslam-vb3se
    @MuhammadAslam-vb3se Před 6 lety +2

    Sir how can i make winform drag able with box. without bunifu

    • @CUiAcademy
      @CUiAcademy  Před 6 lety

      Please watch my this video to learn how to create a drag Control in C#... czcams.com/video/SXZN95pU_s0/video.html

  • @VlcAlexx
    @VlcAlexx Před 4 lety

    Not working

  • @keaan5284
    @keaan5284 Před 4 lety

    Hello my teacher it is tool free?

  • @marcelo2108
    @marcelo2108 Před 6 lety +2

    Why are u using vs2015?

    • @CUiAcademy
      @CUiAcademy  Před 6 lety +1

      Hi Marcelo L.Ponce F.... There is no specific reason for using VS2015.... I am using this because the community edition was available for free download and it is pretty light weight as compared to VS2017, it works fine.... ;)

    • @marcelo2108
      @marcelo2108 Před 6 lety

      ohh! fine data about weight, thanks!

  • @AbsolutelyFake
    @AbsolutelyFake Před 4 lety

    Did not work

  • @puro3186
    @puro3186 Před 5 lety

    3:40

  • @VaVathana-co3nh
    @VaVathana-co3nh Před 6 lety +1

    fantastic