Hi Team
I have a rectangle and in between there is big space in between, want to minimize this space a bit by adjusting the margin of the grid so that it can be pushed a bit closer. How can i achieve such from this below code?
Hi Team
I have a rectangle and in between there is big space in between, want to minimize this space a bit by adjusting the margin of the grid so that it can be pushed a bit closer. How can i achieve such from this below code?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Amira BedhiafiPosted Jan 15, 2025, 11:57 PM
To minimize the space between the rectangles in your WPF Grid, you can adjust the
Marginproperty of theelements to reduce the spacing between them. TheMarginproperty specifies the space around the element in the orderLeft, Top, Right, Bottom.The
Marginfor the second rectangle (Margin="290,104,0,0") places it 290 units to the right of its parent container's left edge. To reduce the space between the two rectangles, decrease theLeftmargin of the second rectangle. For example: