Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Collapse markup borders
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Collapse markup borders

 Post Reply Post Reply
Author
Message
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Topic: Collapse markup borders
    Posted: 27 August 2008 at 8:06am
If I set BorderThickness='1', the outer borders are indeed 1 pixel wide. However, where two grid items meet, the border becomes 2 pixels wide.
 
In HTML you would fix this with "border-collapse", but I can't find this in your markup implementation.
 
How would you accomplish this with XTP 12.0.1?
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 27 August 2008 at 6:24pm
Originally posted by znakeeye znakeeye wrote:

How would you accomplish this with XTP 12.0.1?


12.0.1? 12.0.2 has just been released, so surely you meant 12.1.0

Codejock support
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 28 August 2008 at 1:29am
Hi,
Can you show full markup to try it. I don't see 2 pixels.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 28 August 2008 at 4:18am
No, I meant 12.0.1 since I want to accomplish this right now! :P
 
The inner borders are "doubled". It would be nice if you could "collapse" them to 1 pixel, just like you do in CSS/HTML!
 
------------------Markup-----------------
<StackPanel Background='#e4ecf7'>
<Grid Margin='4'>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Padding='5, 0, 0, 5' BorderThickness='1' BorderBrush='Black' Grid.Column='0' Grid.Row='0'><TextBlock TextAlignment='Left' FontWeight='Bold'>Test</TextBlock></Border>
<Border Padding='5, 0, 0, 5' BorderThickness='1' BorderBrush='Black' Grid.Column='1' Grid.Row='0'><TextBlock TextAlignment='Left'>1234</TextBlock></Border>
<Border Padding='5, 0, 0, 5' BorderThickness='1' BorderBrush='Black' Grid.Column='0' Grid.Row='1'><TextBlock FontWeight='Bold'>Test</TextBlock></Border>
<Border Padding='5, 0, 0, 5' BorderThickness='1' BorderBrush='Black' Grid.Column='1' Grid.Row='1'><TextBlock>1234</TextBlock></Border>
</Grid>
</StackPanel>
Back to Top
jimmy View Drop Down
Senior Member
Senior Member


Joined: 11 November 2003
Location: Austria
Status: Offline
Points: 515
Post Options Post Options   Thanks (0) Thanks(0)   Quote jimmy Quote  Post ReplyReply Direct Link To This Post Posted: 28 August 2008 at 5:22am
You can play with Margin.

<StackPanel Background='#e4ecf7'>
<Grid Margin='4'>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Padding='5, 0, 0, 5' BorderThickness='1' BorderBrush='Black' Grid.Column='0' Grid.Row='0'><TextBlock TextAlignment='Left' FontWeight='Bold'>Test</TextBlock></Border>
<Border Padding='5, 0, 0, 5' BorderThickness='1' BorderBrush='Black' Grid.Column='1' Grid.Row='0'><TextBlock TextAlignment='Left'>1234</TextBlock></Border>
<Border Margin="0,-1,0,0" Padding='5, 0, 0, 5' BorderThickness='1' BorderBrush='Black' Grid.Column='0' Grid.Row='1'><TextBlock FontWeight='Bold'>Test</TextBlock></Border>
<Border Margin="-1,-1,0,0" Padding='5, 0, 0, 5' BorderThickness='1' BorderBrush='Black' Grid.Column='1' Grid.Row='1'><TextBlock>1234</TextBlock></Border>
</Grid>
</StackPanel>

  Jimmy

Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 28 August 2008 at 5:58am
Originally posted by znakeeye znakeeye wrote:

The inner borders are "doubled". It would be nice if you could "collapse" them to 1 pixel, just like you do in CSS/HTML!


CSS/HTML is not the reference here, have you tried your markup in Blend?

Codejock support
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 28 August 2008 at 7:17am
I'm not saying the markup result is wrong. I'm saying I want the damn borders to become 1 pixel wide and I KNOW it is possible, because this is Microsoft we're talking about ;)
 
So, HOW do you accomplish this?
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 28 August 2008 at 7:31am
Hello,
 
They are not double - its borders from left and right border.
 
You can use margins or don't set bottom border for top cells:
 
<Border Padding='5, 0, 0, 5' BorderThickness='1, 1, 0, 0' BorderBrush='Black' Grid.Column='0' Grid.Row='0'><TextBlock TextAlignment='Left' FontWeight='Bold'>Test</TextBlock></Border>
<Border Padding='5, 0, 0, 5' BorderThickness='1, 1, 1, 0' BorderBrush='Black' Grid.Column='1' Grid.Row='0'><TextBlock TextAlignment='Left'>1234</TextBlock></Border>
<Border Padding='5, 0, 0, 5' BorderThickness='1, 1, 0, 1' BorderBrush='Black' Grid.Column='0' Grid.Row='1'><TextBlock FontWeight='Bold'>Test</TextBlock></Border>
<Border Padding='5, 0, 0, 5' BorderThickness='1, 1, 1, 1' BorderBrush='Black' Grid.Column='1' Grid.Row='1'><TextBlock>1234</TextBlock></Border>
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 28 August 2008 at 7:36am
Thanks for your answer. I know I can do the above, but it yields "unclean" code.
 
No other solution? :P
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.