Hi i am working in Silver light I ran into an issue where I had more tab items than could fit within the desired width of my tab control. Instead of all the tab items appearing on a single line, they would wrap and create a multiline affect which I did not want.
1. I wanted the user to be able to scroll through the tab items
Can you all help with this? please correct my direction and with sample code.
Related
Can anyone help with this simple question.
I have a c# ListView. It's the only control on the form. The View property is set to details. When I resize the form I programmatically resize the ListView to fill the whole form.
Problem is, when the form width gets too small to show the lines of text in the ListView it wraps each onto more lines of text - I can just see the top of the characters of the second line.
Thing is, I would rather only have one line per item and the user would have to use the mouse to horizontally scroll the "too long" items - just like in an edit box when the text is too long.
Thanks for any help,
Mitch.
I've been tasked at work with creating a UserControl containing a ListView and ComboBox's for sorting the ListView data. Sorting with the Combobox's s the easy part; the part with which I'm having difficulty is implementing a method of scrolling. In the end, the control should have an Excel-like feel to it. However, sometimes the ListView is too tall or wide for where it is placed. Therefore, there two be two scrollbars somewhere on the control. One vertically moves of the ListView only, and the other moves both the ListView and ComboBox filters horizontally.
Please note in the image above that the ComboBox's do adjust themselves according to column width, but the code for that is not enabled at the moment.
What I've tried: In the control, the filter boxes are in their own panel, and the ListView has had its own panel at times. I've tried using various combinations of the HScroll/VScroll and HorizontalScroll/VerticalScroll properties and the native function ShowScrollBar() for all the controls, but nothing has worked. The only way I've gotten scrollbars to appear is by settings AutoScroll (Scrollable for the ListView) to true. Of course, the scroll bars come in pairs and work only on the same control. I also attempted to programmatically move the scroll bars, but I haven't been able to accomplish that, either.
I've got to be doing something wrong, but I'm not sure what it is. Any help is appreciated!
I think I'd go for a different solution.
If you put the ComboBoxes in a AutoSrcoll panel with the same Anchors as the ListView you would give your users the freedom to scroll the two independently.
Yes, a ScrollBar would appear and take space but I would still happily sell that as a feature, not a bug ;-)
As for handling the Scroll event of a ListView: It is hidden and you'll have to subclass it to get access to it. See here
I am making a WP7 app which has a Listbox of UserControls. Each UserControl has an ItemsControl and Button(for getting more results). On click of the button the ItemsControl items will be increased by 5 or 10.
Now on clicking on the GetMore button of any of the usercontrols except the first or last, there will be an increase in Scrollable height(Total height of the listbox) of the ListBox but the VerticalOffset(position of scrollbar from top) of the ListBox remains same. Now the problem I am facing is that the Vertical Offset is not absolute but relative to Scrollable Height. So the content being viewed till then will be changed basing on the new value of ScollableHeight.
I want to know the relation between them, so that I can do some math and set the VerticalOffset value.
I have added some dependency properties on VerticalOffset and ScrollableHeight through which I can get the events when any of them is changed. Trying to use ScrollIntoView for readjusting the Vertical Offset
Any suggestions or corrections are highly appreciated.
I am not able to find the calculation. But what can be done is listbox can be replaced by a scrollviewer which has itemsControl inside it. But the disadvantage of this is virtualisation is disabled, so will need to check on this.
But, overall this is going to give a bad experience on using such a UserControl in Listbox. So using templated list box given in WP7 toolkit is an option but it is gonna hang a bit since ListBox is not optimized for multi templated virtualization. So I started showing writing listbox item template in such a way it contains all the possible layouts which will enabled from a condition.
I am wanting to create a sivlerlight tab control where the tabs remain on a single line and scroll buttons will allow me to scroll left or right through the tabs. Below is a link to a control that can be purchased but I would like to write my own and share it with the community. I know I can create a inherited class and style with buttons for the tab control. I guess I am confused on how to keep the tabs on one line and scroll the tabs so only half of a tab would be shown. Can you all help with this? If I way off base please correct my direction.
Sample tab control
Recently I have created the TabControl in which the tabs are situated on the single line.
I have written the blog post where I've explained some details.
Also you can download the project directly here.
My first instinct would be to create a control that has a ScrollViewer with a WrapPanel inside it (from the Silverlight Toolkit) that is flowing horizontally. Then you can add the tab buttons to the flow panel and you should have the scroll behaviour.
Of course, if you don't want a scroll bar but instead want buttons, you can do the same thing but hide the scroll bars, then embed the whole thing in a Grid with three columns. Have the ScrollViewer sit in column 0 with a columnspan of 3 and then add a button to columns 0 and 2 that you can show and hide when the mouse rolls over that cell of the grid. You could then somehow scroll the viewer when the buttons are pressed.
How can I make an item inside a ToolBar fill all the remaining available space? Or, how to right-align some items, since that would give me the same effect in my case.
Note that solutions which involve nesting another container (like a Grid) inside the ToolBar don't work since that disables the special behaviour ToolBar gives to it's items (like no normal borders and look, simple outline border on hover, not receiving focus after click, etc.).
Additionally, anyone knows how to get rid of the little button that would show additional icons that overflowed from the toolbar if I had any?
I ended up using this solution:
http://karlshifflett.wordpress.com/2008/01/23/wpf-sample-series-stretch-toolbar-width-of-window/
It's not ideal, but it works. I still don't know how to get rid of the dropdown on the end though.
You can remove the button at the end by re-templating the toolbar. You can likely solve your other query this way too.
I wrote up a soluton for creating a "space filling" label that dynamically sizes to allow to you "right-align" items in a toolbar. Check it out: WPF Toolbar Items HorizontalAligment="Right"