Silverlight Scrolling Tab Control - c#

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.

Related

Custom scrolling in Winforms c#

I am developing an application that will use touch screens to navigate for use in a warehouse environment.
There is a need to present a list to the users and because this list could be quite long, the user will at some point need to scroll down the list.
As you all know the system scroll bars for panels and textboxes etc is quite small and I would like to know if I can either resize the controls that make up the scroll bar (the little arrows at the top and bottom, and the place holder bar in the scroll bar itself), or if I can create a couple of buttons that can scroll up and down my control for me?
Thanks,
Karl
Answer pulled from this post.
Check this out:
Winforms - Adjust width of vertical scrollbar on CheckedListBox
Worth mentioning too:
.NET Compact framework - make scrollbars wider
More of the same, but this time with a better solution through the use of the scrollbar control:
Change the width of a scrollbar
Another one in which the guy teaches how to create your own scrollbar control (interesting):
Set the Scrollbar width of a DataGridView
The last one (worth trying):
Is there a way to get the scrollbar height and width for a ListView control
You can add your own scroll buttons and programatically scroll like so:
myPanel.VerticalScroll.Value++;

Scroll issue - Datagridview in Usercontrol, Usercontrol instances added to Flowlayoutpanel

I have a situation where I am adding multiple User controls (each containintg datagridview control, buttons and radio buttons) in my flow layout Panel (.net 3.5 Winforms). The height of flow layout panel is lesser than grid.
The problem is when I scroll down the the Flowlayout panel vertical scroll and select a cell in the grid the focus moves up at random to a cell, selecting all cells between those two positions.
Suggestions please ?
Thanks!
I think you must be having the same problem as explained in the following URLs:
Why does clicking in a text box cause an AutoScroll panel to scroll back to the top?
http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/445af1e5-0f8d-4e4e-ba97-bc6dc72b5c74/
If so, overriding ScrollToControl as explained in the above URLs can help fix the issue.

Only display complete items in a stackpanel

I have a slider which consists of grid of:
Scrollviewer
Stackpanel (the stackpanel is located inside the viewer)
The slider has 2 navigation buttons to browse trough the selected items.
But how can i only show complete items? Currently some buttons only get shown in half because there is no more space available. In the final version only 5 buttons should be shown at once. But if a certain event is fired more buttons will be visible for.
For example 1-5 are visible. If another button pops up only 2-6 should be visible.
The buttons inside the slider have to be created dynamically.
Does it make sense to stick with stack panel? Cause at the moment the buttons are static.
EDIT: When adding buttons dynamicly to the stackpanel how exactly does this work for already custom made buttons? I can add a normal button just fine but i wish to add the buttons already made below.
I believe the VirtualizingStackPanel (with virtualisation turned on as it is by default) can only perform item-based scrolling (as opposed to pixel-based scrolling). It might be worth trying swapping the StackPanel for a VirtualizingStackPanel to see if that fixes your problem.

Silverlight tabcontrol with scrollable tabItems

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.

How to create an overlay part of control in Winforms C#?

I need to create a custom control that has an expandable part as a panel and a textbox part. The expandable part is a panel, that will either be visible or invisible. But when the panel is visible/expanded directly under the textbox, I do not want the adjacent controls to shift down below the panel, but the panel should just overlay the controls that are there just under the custom control. How would I implement this in Winforms C# project?
I am open to using user control for this scenario.
Thanks
Sunil
I think your implementation of expanding and collapsing is not the best, because you are just overlaying the controls instead of hiding them.
One of the disadvantages is that the overlaid controls might by focussed by pressing tab and they might have a value which I think it is out of target.
I would suggest another implementation by creating two panels (one for the header and another one for the content) and when the collapse button is pressed then the content's panel will be hidden by sitting its Visible property to false and its Hight to 0.

Categories