Тёмный

C# WPF Tutorial #18 - Custom Application Window and Title Bar 

Kampa Plays
Подписаться 7 тыс.
Просмотров 22 тыс.
50% 1

Опубликовано:

 

23 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 48   
@noname4011
@noname4011 10 месяцев назад
WOWW! In every time I watch a video and a question popups in my head you immediately answer it in the video as if you know exactly what I want! Thank youu for your ultimately helpful videoo ❤
@KampaPlays
@KampaPlays 9 месяцев назад
Thanks so much!!
@guilhermebiolchi1179
@guilhermebiolchi1179 3 месяца назад
I'm here to say thanks from Brazil. Your tutorial is very clear and direct to the point. Thank you for the help.
@JackieRoxs
@JackieRoxs Год назад
Thank you so much, I've used WinForms for years, but decided to move to WPF for more UI customizations
@KampaPlays
@KampaPlays Год назад
Awesome! It was a hard jump at first, feeling like reinventing the wheel sometimes, but once I was into it, I was hooked!
@wookyumkim4669
@wookyumkim4669 Год назад
That is another very practically useful tip! Thank you very much!! 😆😆
@KampaPlays
@KampaPlays Год назад
Glad it helped!
@bartsworkshop
@bartsworkshop 8 месяцев назад
I found a bug with the maximize button as the window will go below your taskbar, if you wanna fix it update the code behind to this if (WindowState == WindowState.Normal) { WindowStyle = WindowStyle.SingleBorderWindow; WindowState = WindowState.Maximized; WindowStyle = WindowStyle.None; } else WindowState = WindowState.Normal;
@KampaPlays
@KampaPlays 8 месяцев назад
I'll check this out, thanks for the info!!
@bioanu
@bioanu 11 месяцев назад
Hi Kampa! Very good video about a window customization!! Just a short question: it is possible to add a button inside the TitleBar but without modifying default window style? Thank you!!
@KampaPlays
@KampaPlays 11 месяцев назад
I remember finding a way to do it a very long time ago, but all I really remember about doing it is that it ended up not being worth it. I know this is a bad answer --- but I found this, maybe you can tinker with it and see if it does what you are looking to do? www.codeproject.com/Tips/799302/WPF-Csharp-VB-NET-Additional-fourth-button-on-wind
@bioanu
@bioanu 11 месяцев назад
@@KampaPlays Cool! Why I'm asking this: I like to create an app which can switch between touch mode and mouse mode and I like to customize the main window in this idea.
@nssalon
@nssalon 5 месяцев назад
I love your tuitorial.
@KampaPlays
@KampaPlays 5 месяцев назад
Thanks so much!
@trerouploads8169
@trerouploads8169 15 дней назад
thanbk u so much for the chrome fix stuff
@webdesignsbytom
@webdesignsbytom Год назад
I will remember to go backk and like every video
@KampaPlays
@KampaPlays Год назад
Really appreciate it!
@fooballers7883
@fooballers7883 Год назад
Brilliant tutorials.... Thank you
@KampaPlays
@KampaPlays Год назад
Thank you!!
@14768
@14768 Год назад
I suppose I could probably test this but when you make a custom title bar like this does it still allow snapping to left / right / top / bottom splits?
@KampaPlays
@KampaPlays Год назад
I will say, it *should* continue to allow default windows snapping behaviors, but I have seen issues where certain UI layouts prevent it from working. Great question.
@frednicholson
@frednicholson Год назад
There must be more going on here. I used the windowstyle just like you did and the title bar didn't disappear. In fact, in one case, it goes to the bottom of the window.
@KampaPlays
@KampaPlays Год назад
Whaaaat? I can't say that I've ever seen that happen. Can you share your window code with me?
@WIckedOmenOfThunder
@WIckedOmenOfThunder Год назад
Hey Kampa! Could you make a video about MVVM, and how you keep things nice and separated yet functional?
@KampaPlays
@KampaPlays Год назад
Hey! Yes, I will be getting to a few videos about MVVM very shortly!
@Jumph96
@Jumph96 Год назад
@@KampaPlays Looking forward to those..👍👍
@thecoweggs
@thecoweggs 2 месяца назад
GOAT
@GuitarAge
@GuitarAge Год назад
Thank you! )
@KampaPlays
@KampaPlays Год назад
Glad to help!!
@jurgenmarkus1345
@jurgenmarkus1345 Год назад
Thanks!
@KampaPlays
@KampaPlays Год назад
Thanks so much! Appreciate that!!
@sajmonator7325
@sajmonator7325 7 месяцев назад
I just wonder. Once you create nice window, how can you reuse it without copying whole bunch of code every time? I can't inherit from custom window, can I?
@KampaPlays
@KampaPlays 6 месяцев назад
Sorry for the delay - You could stick all of your custom window code in a C# library (.dll) and import it into each project. If you mean within the same project, you could create a parent window class and inherit from it.
@rajivlather8918
@rajivlather8918 Год назад
👍
@ion4798
@ion4798 Месяц назад
oh, that is simple, but there is one more thing, when window is maximized you must be able to drag window , that is tricky
@robinheyer708
@robinheyer708 Год назад
That WindowChrome setting put me in a 7px nightmare lol. Maybe I'll just remove the maximize button... :P
@KampaPlays
@KampaPlays Год назад
🤔 Interesting! What exactly is it doing? You are using WindowStyle.None?
@robinheyer708
@robinheyer708 Год назад
@@KampaPlays Yes, exactly. So now that annoying white bar at the top (which I now know is 7px high) is gone but that also means your window is missing 7px at the top and the sides when you maximize it. Which means part of your buttons will look like they're cut off. I tried a quick fix with making the row 7px higher and then adding 7px margin at the top of the buttons and 7px on the right of the close button but it just ends up looking slightly less dorky than it did with the original white bar. ;)
@KampaPlays
@KampaPlays Год назад
@@robinheyer708 Ah!! Yes!! Thank you for pointing this out, it just slipped my mind! (Sorry!) Hopefully your comment will help others as well!!
@dakloafitz6347
@dakloafitz6347 Год назад
Hey :) In most windows you can´t just dragmove, but also double klick to maximize the window. First of all, i didn´t use the windows MouseLeftButtonDown event, but a rectangle. DragMove worked. Then i tried to get the doubleClick event, but ractangles dont have those. So i switched it to a button, because those have both events. Now the doubleClick works, but DragMove doesn´t work with a button. Any ideas?
@dakloafitz6347
@dakloafitz6347 Год назад
Got it, I have to use PreviewMouseLeftButtonDown and PreviewMouseDoubleClick :)
@KampaPlays
@KampaPlays Год назад
Good addition! If your control you are attempting to drag/hover/click handle isn't a simple space like a grid, the control where your mouse is may precedence of those events depending on what the control itself does. (So you can focus a textbox or enter a datagrid, for example, instead of dragmove taking over those abilities). Nice job figuring it out, this will probably help someone! :)
@robinheyer708
@robinheyer708 Год назад
I actually had the dragmove event auto-complete as PreviewMouseLeftButtonDown instead of just MouseLeftButtonDown. Then I spent a few minutes clicking the X and reloading the app like an idiot without anything happening. :P
@KampaPlays
@KampaPlays Год назад
@@robinheyer708 Ahhhh! Auto-complete has burned me more times than I'd like to admit 🤣
@tranguyentruc7033
@tranguyentruc7033 9 месяцев назад
how to write symbol maximize?
@KampaPlays
@KampaPlays 9 месяцев назад
You can use codes, but honestly sometimes, I just search for and copy and paste the unicode character itself: 🗖
@CapPat855
@CapPat855 3 месяца назад
🗖
Далее
WPF C# Professional Modern Flat UI Tutorial
36:44
Просмотров 830 тыс.
Cool Wrap! My Book is OUT 🥳
00:27
Просмотров 1,9 млн
Кольцо Всевластия от Samsung
01:00
Просмотров 664 тыс.
That was too fast! 😲
01:00
Просмотров 4,7 млн
Is LEARNING WPF still WORTH it in 2023?
10:59
Просмотров 54 тыс.
If __name__ == "__main__" for Python Developers
8:47
Просмотров 409 тыс.
WPF C# MVVM Sample Application
13:16
Просмотров 19 тыс.
I Made the Same Game in 8 Engines
12:34
Просмотров 4,2 млн
C# WPF Tutorial - Multiple Views
20:00
Просмотров 167 тыс.
C# WPF Tutorial #20 - Reusable Style Resources
11:11
Просмотров 15 тыс.
C# WPF Modern UI Flat Design Tutorial
20:25
Просмотров 220 тыс.
C# WPF and GUI - Pages and Navigation
7:48
Просмотров 283 тыс.