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

Поделиться
HTML-код
  • Опубликовано: 10 янв 2018
  • 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/SaLaaRHuSyN/Resize...
    ++++++++++++++++++++++++++++++++++++++++++++
    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.
  • НаукаНаука

Комментарии • 108

  • @balasenk
    @balasenk 6 лет назад +13

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

  • @leobarbosa173
    @leobarbosa173 6 лет назад +5

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

  • @qusaidarwish7506
    @qusaidarwish7506 5 лет назад +2

    Perfect ! Thanks Dude ! From 2019

  • @user-tn3bw1wg8w
    @user-tn3bw1wg8w 6 лет назад +9

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

    • @CUiAcademy
      @CUiAcademy  6 лет назад +7

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

  • @roul3688
    @roul3688 4 года назад +4

    You are the man/woman! Thanks for this!

  • @semosemo3827
    @semosemo3827 3 года назад +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);
    }

  • @smsoorganization292
    @smsoorganization292 6 лет назад +2

    hey i like your tutorials thank you and Jazakalahu khayr

  • @ralphipeyrna6989
    @ralphipeyrna6989 6 лет назад +1

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

  • @Hamiscool
    @Hamiscool 2 года назад

    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.

  • @manjeetnandal1
    @manjeetnandal1 4 года назад

    Many useful!
    Many thanks!

  • @neilluck1759
    @neilluck1759 Год назад

    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?

  • @vac416
    @vac416 5 лет назад

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

  • @alphacentauri6343
    @alphacentauri6343 6 лет назад +1

    like before i watch

  • @yokozuna021
    @yokozuna021 4 года назад +1

    Thank you so much!

  • @heko9122
    @heko9122 4 года назад

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

  • @AaricAaiden
    @AaricAaiden 6 лет назад

    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 RUclips but nothing worked exactly same as i want.

  • @mrsterbenblack9270
    @mrsterbenblack9270 6 лет назад +1

    great work!

  • @zayantorres4523
    @zayantorres4523 5 лет назад +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  5 лет назад

      Hi Z-Man... Pleaee watch my this video to learn how to create your own drag control in C# ruclips.net/video/SXZN95pU_s0/видео.html

  • @carlmarionmanlapaz4697
    @carlmarionmanlapaz4697 4 года назад

    very informative. subscribed.

  • @Sixthflyer
    @Sixthflyer 6 лет назад +1

    Well done!

  • @mnlfrk
    @mnlfrk 6 лет назад +1

    Fantastic

  • @squad-failure
    @squad-failure 4 года назад

    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...

  • @Thepostroun
    @Thepostroun 3 года назад

    thanks this video is so greaat!

  • @essouaiedameur7642
    @essouaiedameur7642 3 года назад +1

    how can I add the bunifu package to my VS2019

  • @aylakhan4699
    @aylakhan4699 6 лет назад +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 6 лет назад

      perfect thx a lot kindly regards

  • @darius8171
    @darius8171 6 лет назад +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  6 лет назад +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 6 лет назад +1

      Thank you!

    • @LucifiedPower
      @LucifiedPower 2 года назад

      @@darius8171 can you give me the code

  • @nesyta1749
    @nesyta1749 6 лет назад

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

  • @seikosantana2313
    @seikosantana2313 Год назад

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

  • @manjeetnandal1
    @manjeetnandal1 4 года назад +1

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

  • @imamhossain1818
    @imamhossain1818 4 года назад +2

    Thank you sir

  • @TesearBlogspot
    @TesearBlogspot 4 года назад

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

  • @enessolmaz9548
    @enessolmaz9548 3 года назад

    Thanks bro 😊❤️

  • @ezequiasrocha3037
    @ezequiasrocha3037 4 года назад

    The download isn't available anymore.

  • @SeekersforSeekers
    @SeekersforSeekers 4 года назад +1

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

  • @abdalahali6746
    @abdalahali6746 5 лет назад

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

  • @lephonghaiful
    @lephonghaiful 4 года назад

    link dowload is dead, please refresh it.

  • @z0rd.154
    @z0rd.154 4 года назад

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

  • @agusd3327
    @agusd3327 4 года назад

    thank you very much

  • @zeeshanmushtaq7039
    @zeeshanmushtaq7039 2 года назад

    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  2 года назад

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

  • @warmice8265
    @warmice8265 3 года назад +3

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

  • @ayushpramanik808
    @ayushpramanik808 2 года назад

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

  • @xheptc9612
    @xheptc9612 4 года назад +1

    We create, We Design, We develop.

  • @softmetric6140
    @softmetric6140 3 года назад

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

  • @mariokiric
    @mariokiric 6 лет назад +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 6 лет назад +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 6 лет назад +1

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

    • @mariokiric
      @mariokiric 6 лет назад

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

    • @brazo98
      @brazo98 6 лет назад +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 6 лет назад

      Brazo Danke ;)

  • @Thepostroun
    @Thepostroun 3 года назад

    nice

  • @leftofzen
    @leftofzen 5 лет назад

    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 2 года назад +1

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

  • @korichiTarzi
    @korichiTarzi 6 лет назад +1

    good

  • @TERIHAX
    @TERIHAX 3 года назад

    it's not working for me.

  • @user-xu9rz7he2i
    @user-xu9rz7he2i 2 года назад +1

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

  • @ethanhill2016
    @ethanhill2016 4 года назад

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

    • @CUiAcademy
      @CUiAcademy  4 года назад +1

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

    • @ethanhill2016
      @ethanhill2016 4 года назад

      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  4 года назад +1

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

  • @FanmadesMv
    @FanmadesMv 4 года назад

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

  • @kyleb3316
    @kyleb3316 2 года назад

    my eyesssssss >.

  • @erithia--51
    @erithia--51 3 года назад

    tysm

  • @jhwils
    @jhwils 4 года назад +3

    The Link for source code is dead😰

    • @CUiAcademy
      @CUiAcademy  4 года назад +1

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

    • @matejpesl6442
      @matejpesl6442 3 года назад

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

  • @MuhammadAslam-vb3se
    @MuhammadAslam-vb3se 5 лет назад +2

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

    • @CUiAcademy
      @CUiAcademy  5 лет назад

      Please watch my this video to learn how to create a drag Control in C#... ruclips.net/video/SXZN95pU_s0/видео.html

  • @VaVathana-co3nh
    @VaVathana-co3nh 6 лет назад +1

    fantastic

  • @pedrohenriwue6327
    @pedrohenriwue6327 6 лет назад +1

    must have Buniffu?

    • @CUiAcademy
      @CUiAcademy  6 лет назад +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 6 лет назад

      Thanks

  • @kyrollosemad5319
    @kyrollosemad5319 5 лет назад

    can you mae a tutorial in vb.net please

  • @marcelo2108
    @marcelo2108 6 лет назад +2

    Why are u using vs2015?

    • @CUiAcademy
      @CUiAcademy  6 лет назад +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 6 лет назад

      ohh! fine data about weight, thanks!

  • @VlcAlexx
    @VlcAlexx 4 года назад

    Not working

  • @keaan5284
    @keaan5284 4 года назад

    Hello my teacher it is tool free?

  • @mohammadahsan5655
    @mohammadahsan5655 3 года назад +1

    Form is not resizing, whats the problem ?

    • @CUiAcademy
      @CUiAcademy  3 года назад

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

    • @mohammadahsan5655
      @mohammadahsan5655 3 года назад +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  3 года назад

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

    • @mohammadahsan5655
      @mohammadahsan5655 3 года назад

      @@CUiAcademy I am sharing the complete form

    • @mohammadahsan5655
      @mohammadahsan5655 3 года назад

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

  • @AbsolutelyFake
    @AbsolutelyFake 4 года назад

    Did not work

  • @hiddenhidden6340
    @hiddenhidden6340 4 года назад

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

  • @mohammadahsan5655
    @mohammadahsan5655 3 года назад

    Bhai yr bta do, mai b Pakistan sy hnn

  • @puro3186
    @puro3186 5 лет назад

    3:40

  • @zeeshanmushtaq7039
    @zeeshanmushtaq7039 2 года назад

    😪please helpme

  • @wakcy
    @wakcy 4 года назад +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;
    }
    }