SirDurpsalot
SirDurpsalot
CC#
Created by SirDurpsalot on 5/10/2024 in #help
Adding a picture to a button in a style for a window
So I have a style resource dictionary that cam from a different project. There they made a style for a window with custom buttons and title bar. For the buttons they used images that were saved in the project in a folder. When I try to add this resource dictionary to my own project and added it to app.xaml everything works except the pictures in the buttons. Could someone please tell me why this doesnt work for me? ( I am still a beginner at this so it might something simple I just don't know) the (I removed a lot of the code but I left the top part so you can get an idea of what the structure is. You can find the full code in the pastbind below)
<Setter>
<Setter.Value>
<ControlTemplate>
<Border>
<Grid>
<Grid>
<Stackpanel>
<Button Style="{StaticResource Windows95CaptionButton}"
x:Name="PART_MinimizeButton">
<Button.Content>
<Image Height="14"
Width="16"
SnapsToDevicePixels="True"
Source="../Images/close.png" />
</Button.Content>
</Button>
<Setter>
<Setter.Value>
<ControlTemplate>
<Border>
<Grid>
<Grid>
<Stackpanel>
<Button Style="{StaticResource Windows95CaptionButton}"
x:Name="PART_MinimizeButton">
<Button.Content>
<Image Height="14"
Width="16"
SnapsToDevicePixels="True"
Source="../Images/close.png" />
</Button.Content>
</Button>
thanks in advance! https://pastebin.com/uFQP80Hx And the full project where I took this code from: https://github.com/vddCore/Windows95-WPF/tree/master
1 replies
CC#
Created by SirDurpsalot on 5/8/2024 in #help
resource dictionary confusion
So this is a really weird question, so bear with me as I'm gonna try explaining. I am building a WPF project and I was looking for a way to style everything in the old Windows 95 style but with my own colours. I found a github repository where someone made a custom window that uses the windows 95 theme. I have been looking through the code for hours and I was finally starting to understand it. But then I found that in the file Windows95/Themes/Generic.xaml, which is a resource dictionary, another resource dictionary is used. But I cannot for the life of me figure out where this Generic.xaml file is used to skin the window. Whenever I use the Windows95Window class as my window it works, but when the Generic.xaml file is removed it stops working. the only reference used in App.xaml is to another resource dictionary that has nothing to do with Generic.xaml. I have tried using Ctrl+F, Ctrl+Q, Ctrl+T etc. but I cannot find how this works. This is a big ask but could someone look through the code and see if they find how this project is made? https://github.com/vddCore/Windows95-WPF/tree/master
3 replies
CC#
Created by SirDurpsalot on 5/6/2024 in #help
✅ Winforms redraw question
No description
15 replies