How to Drag and Resize border-less Winform Application C#
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.
Hello team, am the fan of you guys, every video's is interesting and design is awesome,. Thanks.
I'm from Brazil, Rio de Janeiro, I really enjoy these tutorials :):):)
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);
}
Спасибо большое, за ваши видео уроки!))
Спасибо, что посмотрели мои видео. :) :)
You are the man/woman! Thanks for this!
Man... :) :)
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 ..
perfect thx a lot kindly regards
hey i like your tutorials thank you and Jazakalahu khayr
Can I resize the form without using Bunifu ?
Thanks.
P.S. : Great video !!!
I comment here to let you know that one more Vietnamese person knows you :v.
how can I add the bunifu package to my VS2019
We create, We Design, We develop.
@- Vrex - lol
Designing is ok, but we want the back-end. Because we want to develop more beautiful + functional applications.
Perfect ! Thanks Dude ! From 2019
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?
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)
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...... :) :)
Thank you!
@@darius8171 can you give me the code
i watched ur first video..this one and subscribe ur channel..
Stay Tuned for More Videos.. :) :)
@@CUiAcademy definitely i will be
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.
i need it but with ismdicontainer active in the form, is this possible?
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...
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.
very informative. subscribed.
But lack of source codes!
Anyway, great sharing!
Great thanks!
Okay, to use that thing you need to buy that...
Thank you sir
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)
Hello sir please make a video on
"how to drag and resize borderless winform in powershell studio"
Please Sir
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!
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
Und er hat die DLL mit eingefügt heisst Bunidragcontrol. Da fallen dann Lizenzgebühren an wenn das nutzen willst.
Brazo Ok, Vielen Vielen Dank! :D Wie sollte es dann aussehen ohne der DLL? Bin kompletter Anfänger ;)
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!)
Brazo Danke ;)
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;
}
}
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
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
like before i watch
Fantastic
Nice! Can it maximize when being pulled to top of desktop?
How do we make the window bigger?, we can only make the window smaller
Why isn't working if the panel is dock=fill
Thank you so much!
how to resize when a panel or control with Dock = Fill on the form?
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
ClientSize.Width - cGrip and Height - cGrip.
Its minus there after width and height, not equal sign.
I hope it will fix your problem.. 🙂
thanks this video is so greaat!
Form is not resizing, whats the problem ?
Please make sure you've added the line of code in the constructor of form i-e this.SetStyle(....
@@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. ????
@@mohammadahsan5655 please share you piece of code to salaarhusyn@gmail.com I will review it
@@CUiAcademy I am sharing the complete form
@@CUiAcademy I have send you the form by mohammadahsanissb.pk.2020@gmail.com Please resolve the issue.
Many useful!
Many thanks!
The download isn't available anymore.
Magic number shit form stack overflow... not really what i was searching for but thanks anyway
How can you do that so that you can move these windows to MDIParent?
nice
great work!
Почему когда я ввожу в toolbox "drag", то у меня нет результатов?
Well done!
Thanks bro 😊❤️
The Link for source code is dead😰
Please download it from my github profile.... Link is given in the description of my other videos...
@@CUiAcademy You don't have the project on your github profile.
thank you very much
link dowload is dead, please refresh it.
link to download source code dosent work plz any one have downloaded it send here thank you
it's not working for me.
I am able to resize it but my content is not affected, how do i make it so the content is pushed?
Select your controls, go to properties and set Anchor property to None..
I hope it will work for you... :)
C# Ui Academy ok I have done that but now my label over laps my head panel after I resize it too small
@@ethanhill2016 Select your form, go to properties and set a Minimum Size for your Form.
good
my eyesssssss >.
Можете дать ссылку на вашу программу на гитхабе? не как не могу найти :(
Hi sir please consider to prepare your designs first and then make a tutorial,
Your half video is an advertisement.
Bhai yr bta do, mai b Pakistan sy hnn
😪please helpme
can you mae a tutorial in vb.net please
tysm
must have Buniffu?
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);
}
Thanks
Sir how can i make winform drag able with box. without bunifu
Please watch my this video to learn how to create a drag Control in C#... czcams.com/video/SXZN95pU_s0/video.html
Not working
Hello my teacher it is tool free?
Why are u using vs2015?
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.... ;)
ohh! fine data about weight, thanks!
Did not work
3:40
fantastic