R
R
Rag'n' Code Man2020-03-07 00:44:14
Design
Rag'n' Code Man, 2020-03-07 00:44:14

How to make a WPF button?

Good evening everyone!

One of these days I decided to start studying WPF, and my dislike for the standard Windows Calculator prompted me to do this.

I myself, of course, am not a .NET programmer with 20 years of experience, I'm just learning this language, but I think I'm already ready for WPF.

In general, I started with the design of my own product, I did it in the style of the iPhone
5e62c16fef75c358110062.png

. This is the story that turned out.

Then, to celebrate, I opened the studio, created a project and started writing something in XAML. Two days in a row my progress was, to put it mildly, "so-so".

I decided to start with the AC button , created a grid, positioned the button, nothing happened, went to bed.

The next day I read some more material on Metanit and got motivated to start coding again.

Finally, I began to understand at least something in this, and I, sort of, how it turned out ( no ).
5e62c2bc92113090763518.png

The studio says it's great! I start the project, thinking that the moment has come when this damn button will become the way I want, and ... no ...

The program itself for some reason looks like this:
5e62c3066dcc8507517009.png

I already have a headache googling about this WPF , especially since I stupidly do not understand half of what I found.

And the code for the button is this:

<Border Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="3" CornerRadius="40" Margin="10px, 0, 10px, 0" Background="#383838">
            <Button OverridesDefaultStyle="True" Background="#383838" Foreground="#ECF1FF" FontSize="50px" FontFamily="SFNS Display" Width="350px" Height="70px">
                AC
            </Button>
</Border>


I don't understand why the constructor and the program itself show me completely different things?

Perhaps I do not understand the hierarchy of WPF elements, maybe somewhere I wrote an absolutely stupid code from the point of view of logic ( WPF ).

Anyway, I'm only working with him for the third day (Maybe I took a too complicated project?).

PS If there are girls here, then Happy Holidays!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
d-stream, 2020-03-07
@iDmitriyWinX

https://docs.microsoft.com/en-us/dotnet/framework/...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question