I am working now on the project for my client, which is something like Display Editor, where user can add display, write something in it etc... Every display is connected to another display, by that I mean, it has Parent, Left/Right Sibling and Child. Its practically linked list. And you can jump from one display to another with arrows keys Up, Left, Right and Down. All this is completely okay. My problem is, that client want something like treeView, but horizontal. Because when I use normal treeView, Display dont match with the arrows rules (Up,Left etc...), Its vice versa.
I was desperate so I created my own Control, where I am adding Labels and every time new Node is added I am changing Location of already exists Labels. Here are some images.
Second child of "Right Sibling"
"Right Sibling
But as you can see, its not looking very nice and also its not very good for using. Also I cant figure how to delete there, because location changing when deleting something is too much complicated. I searched a lot and I saw like thousand articles, but everything useful is for WPF and I am using Windows Forms, that is the problem. I am afraid I will have to figure it out, but first I am calling for help. Thank you.
Related
I've been making a stock tracker app in C# with Windows Forms for fun, besides a few issues everything is going relatively well.
Except: I don't know how to make the lay-out do what I want it to do. In particular, I want to makes sure that a set of buttons (add, delete, exit) within a TableLayoutPanel at the bottom always remain in the same space with the same size. I've tried things like docking, setting Min/Max sizes, anchoring, locking but I just can't seem to get it right. They will keep moving around/changing shape.
I've recorded a short video to illustrate my point: https://puu.sh/IszTh/7c31c8e846.mp4
Anyone have any advice? I didn't think it would be necessary to show the code but if you do need it just tell me to edit this post.
As Jimi pointed out in the comments to the question, I hadn't set the absolute value for the TableLayoutPanel containing previously mentioned TableLayoutPanel.
I've been trying the new Microsoft Band SDK, especially the support for buttons (finally), but got stuck on trying to create buttons with images on top. Tried what's described in the oficila SDK doc ([page 29, topic 2.7.2.1 - Negative Margins][1]), that states that, defining margins with a negative value for the second child, makes them item on top (in this case an image/icon on top of a button), thus making an image button.
The result I'm getting are either:
A button with an image under it
An image over the button, but making the button non clickable (changing the order of the items inside the Panel).
Has anyone tried this?
Been banging my head for a few days with this.
Help would be much apreciated.
Cheers!
Thanks for reporting this issue Daniel. Currently the button + overlapping icon scenario will not work. A future software release will address this problem.
Note that the z-order of child elements of a container is topmost (first child) to bottom (last child). So, the order of elements in the FlowPanel would need to be {icon, button} such that the icon gets rendered on top of the button. The example in the SDK doc is incorrect in that it specifies the order as {button, icon}. However, while fixing the order is a necessary step to getting the scenario to work, it alone is not sufficient, the aforementioned future software release will be required as well.
I have the need to make a control that allows for multi directional scrolling, but only for specific elements within the scollviewer.
Something like this:
The control is split into 4 parts.
Top left is a static header, it will not move when scrolling.
Bottom left works like a listbox, only scrolls up and down.
Bottom right can scroll in all directions but needs to be in sync with the scrolling of the bottom left area.
Top right is the header for the content in the bottom right, and must be in sync as well.
There is an app on the Windows Store now called Project Timeline, and it appears they have done this with 1 ScrollViewer, but im not entirely sure how.
I've implemented a solution with 2 scrollviewers, but between the 2 scrollviewers there is scroll tearing on slower devices, and this is unacceptable.
Anyone have any ideas how this can be done with 1 scrollviewer?
PS, I'm looking for a XAML solution, not a WinJS solution.
Thanks.
Looking for days, didnt find anything, then as soon as I post this question i figure it out... typical right?
This is accomplished with:
ScrollViewer.TopLeftHeader
ScrollViewer.TopHeader
ScrollViewer.LeftHeader
http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.scrollviewer.topleftheader
I'm trying to convert a form which I currently have in C# to Java, utilising layout managers. And it's turning out to be a nightmare.
I've tried setting the sizes of the components, however no difference is present. Also, I cannot get the labels and textboxes to move closer to each other.
For all of the buttons and text fields, just put then in a Panel that has nothing but that one item in it. That will prevent the button/textfield from filling the entire space in the layout.
Other than that the only thing it seems you need to do is put a bit of a margin around the whole thing so that your items aren't right up against the edges of the window.
Try GridBagLayout instead of GridLayout.
GridLayout forces all components to be the same size.
See also javax.swing.Box, to put the label - text field pairs in one pane.
I am currently working on a Silverlight application using the Bing Map control, i am using a custom pushpin made up of an Image and a text block within a grid element, which works fine, this also allows me to have hover and right click events for each pushpin so all good so far, however there is a need for me to enable the user to drag the pushpin in any direction and have an a line connecting it to its actual position, sort of like an anchoring point.
I am struggling to see how to do this, I have seen lots of information on making the pushpins have the capability to be moved by the mouse but the line and anchor part is causing me a bit of a problem. Currently i keep my pushpins in various Observable Collections so that when they are updated the UI updates. If anyone has an Idea on a clean way of adding this functionality please let me know it will be much appreciated.
Many Thanks
I haven't got time to knock up a complete example. However I'll give away the basis of the solution. Replace the template with one based on a Canvas. For example you could have an ellipse to be the actual point on the map, a draggable border that has the ContentPresenter and a line to act as a tether.
The code needed is a) allow the Border to be dragged about and b) to move one end of the line about so that it lies under the Border.
I am still interested in other approaches but I have come up with a solution of paring my pushpin element with a MapPolyline, this in conjunction with the mouse handling to allow the user to drag the pushpin updates both, it is pretty effective and will do for now. I would still like to hear from anyone else with better suggestions though.