Is it possible to add your own button in the add area, next to the AddNewBox?
I want a delete button alongside it.
When I position it next to it in the desinger and anchor to bottom and right it doesn't want to show it in the add area.
After playing around some more, I did get the button in the position I wanted.
I had to anchor it bottom and left.It had to be aligned so the top of it was at the top of the "Start! Click start to"... area below the grid.
Do you think this is a reliable solution?
My concern now is how to ensure the style of my button always matches the style of the add button.Could machine settings change the style of the add button?Would you recommend hard coding an appearance in the DisplayLayout.AddnewBox.Appearance?
Hi,
Positioning a button control over the grid may work, but there are a couple of issues you might need to deal with.
First, there's the appearance of the button, as you mentioned. If you have themes turned on, which is the default, then the answer is yes - different machines might display the button differently. But that's okay, since all of the buttons in the application will be affected in the same way. So I think you are probably okay there.
The bigger issue is positioning. If the machine you are running on is using a different font size, then this might cause the button to be positioned in correctly relative to the grid. I'm not sure if this is a problem, you might want to test it out and see. Just build your app, then close it and change your font size on your system and then run the app and make sure it looks okay.
An alternative would be to use a CreationFilter. This would allow you to position the button control relative to the AddNewBox and the buttons in it, or even to add a ButtonUIElement into the AddNewBox, rather than using a Button control. But it's probably easier to just do what you are already doing unless there's a problem with it.