I've searched loads for an answer to my problem.
Basically on my WP8 app, I have an "add record" page and a list of text boxes. I can scroll up and down the full length of the page fine, but when I tap one of the text boxes and the keyboard appears, I can no longer scroll to the very bottom and therefore can't complete the last couple text boxes.
Now, if you have a look at the MS calendar app on WP8, the "new appointment" page has a similar thing - when you tap one of the text boxes you can still scroll the whole way up and down.
I was wondering, is there anywhere I can see the XAML that MS have used? Then I can learn from that. I'm sure it's as simple as setting a height property or something but I've been stumped on this for a while now.
Rather than posting my XAML etc, does anyone know where I can get a look at the XAML for the MS stock apps? If this is even possible...
Thanks
I had the same issue. but at last i solved it, i just used the Height property to do this. i already answered for the same type of problem posted by someone.Please do the following steps
First create a ScrollViewer
Indide the ScrollViewer create a container(eg: Grid/StackPanel/Border etc...) and put every controlls inside it.
Set fixed Height for ScrollViewer and the Container (Note: Height of container should be greater than ScrollViewer's Height)
See the below Code
<ScrollViewer Height="500">
<Grid Name="Container" Height="700">
<TextBox/>
<TextBox/>
<TextBox/>
</Grid>
</ScrollViewer>
Now you can scroll the container Grid Even the KeyBoard shown or even focus on a TextBox.
Related
I'm trying to change the width of the scroll bar of a WebBrowser control.
I tried following this answer to change its ScrollViewer like this:
<WebBrowser Grid.Row="0" Grid.RowSpan="5" Grid.Column="0" Height="1993" Margin="3,3,0,3">
<ScrollViewer>
<ScrollViewer.Resources>
<sys:Double x:Key="{x:Static SystemParameters.VerticalScrollBarWidthKey}">100</sys:Double>
</ScrollViewer.Resources>
</ScrollViewer>
</WebBrowser>
But I'm getting The type 'WebBrowser' does not support direct content error.
I know that the WebBrowser of WPF is just a wrapper around WinForm's so I'm guessing this is why I'm getting this error.
I don't want to use external components such as CefSharp or other browsers.
Is it possible using the native WebBrowser?
Thanks
The WPF WebBrowser control actually wraps the native WebBrowser ActiveX control inside it. That doesn't really change the answer but it's good to know.
As Reza Aghaei already commented, the scrollbars are not WPF controls and cannot be modified like other scrollbars in WPF applications. However, I don't think that you can change the width of the IE scrollbars using CSS, because the styling is only limited to coloring:
scrollbar-base-color: #C0C0C0;
scrollbar-base-color: #C0C0C0;
scrollbar-3dlight-color: #C0C0C0;
scrollbar-highlight-color: #C0C0C0;
/* etc */
Two possibilities come to mind. Either you use one of the jQuery scrollbar libraries that let you customize the scrollbar, or you use the native WPF ScrollBar instead.
Using jQuery scrollbars would force you to inject javascript on each page the user visits and it might get really dirty when the website already has custom jQuery scrollbars in use. This could be worth looking into, but I doubt it would work well enough in practice.
Here's what I would try
Hide the scrollbar by giving overflow:hidden style to the body of each page. You could also host the Windows Forms WebBrowser inside the WindowsFormsHost control so you would get access to the ScrollBarsEnabled property (which unfortunately isn't available on the WPF control).
Add the WPF ScrollBar next to your WebBrowser control and style it the way you want to. This could actually be a UserControl to ensure future reusability.
Set the WPF ScrollBar's maximum value to the ScrollHeight of the HTML page.
Subscribe to the scroll event of WPF ScrollBar. Send the scroll events to the HTML page. You would also need to do it the other way to keep the WPF ScrollBar synced with scroll that happens using touch, mouse wheel or keyboard buttons.
I'm not on a computer right now so can't help with the numbers 3 and 4 but it should certainly be possible. Again you could run into pages that use some custom scrolling (jQuery) but hopefully this gets you started.
i'm fairly new at this so i apologize in advance if i say anything stupid.
I am making a UI in WPF that consists of 8 buttons to open various programs set on my computer. Currently i am trying to get the buttons in the UI to scale based on the detected window size.
The problem i am having is trying to get the calculations done in the C# code to link over to the scale transform option for the buttons in XAML.
I have searched high and low to find a solution but i still cannot find a way to link the value to XAML. Does anyone know of a guide for something like this and should it be done using a converter?
Thanks for any help.
When you need your content to autoscale, put it all into a ViewBox control.
<Window>
<Viewbox>
<Grid x:Name = rootGrid>
</Grid>
</Viewbox>
</Window>
Now everything will magically fill to the window size and scale! Instant awesomeness for your app.
I am developing Windows store apps. In one of the apps, instead of having image controls, I would like to have container controls that display single animated images from within (Similar to the News Bento app welcome screen on Windows 8). The closest I have come to that is AnimatingContainer control from WinRT XAML toolkit, but it doesn't seem to work with images (At least in my case). Any help on how to use this control to animate an image or any other solution will be grateful. Below is my XAML code. If I uncomment the text block and comment the image, the text block is displayed animated. But the reverse isn't true.
<Controls1:AnimatingContainer HorizontalAlignment="Left" Height="311" Margin="163,23,0,0" RadiusX="25"
RadiusY="10"
Duration="0:0:10"
VerticalAlignment="Top" Width="461">
<!--<TextBlock Text="Sume Rossini" FontSize="66"/>-->
<Image Source="Assets/Davy_Jones.jpg" Width="300" Height="500"/>
</Controls1:AnimatingContainer>
There likely isn't any. You would need to write one yourself to fit your specific requirements. Use Blend to create the animation. Ask more specific questions and you may get help implementing it.
Hello I'm having some issues in Silverlight to make sure the scrollbar resets every time the user is navigated to another page. There is another issue I'm having where the scroll down arrow is not appearing when I debug my application. Any help will be appreciated
Here is an example on how to change the scroll-bar position
XAML
<ScrollViewer x:Name="ScrollBar>
</ScrollViewer>
Code Behind
ScrollBar.ScrollToHorizontalOffset(0d);
ScrollBar.ScrollToVerticalOffset(0d);
Change 0 to the position you want. 0 will bring it to the top.
As for the down arrow not appearing....that's a problem with your UI. Make sure the ScrollViewer doesn't extend off the screen.
I just switched over to WPF from just regular C# .NET for the more advanced UI design controls. I have managed to become extremely confused over what should be extremely simple, and I hope someone can help.
Basically I want to have sections on either side (for the most part these will be list-boxes inside of expanders), one list-box in the bottom-middle, and then a large rich text box taking up the middle.
My understanding was that I could just take a DockPanel, set the ChildFill to true, dock each one where it should go, and leave the last one to fill the space. The list boxes alone don't seem to work at with the DockPanel, and the DockPanel does not seem to expand when I change the size of the window.
So basically my questions are...
1) Why does the DockPanel not expand/shrink when I change the size of the window?
2) Buttons seem to work fine in the Dock Panel (like all of the examples I found) but using List Boxes instead does not seem to work properly. Why is this?
3) If I put the list boxes inside of Expanders instead, if I have say two of these on the left side, and I shrink the top expander, will the bottom expander grow upwards to fill the gap?
I can't really afford anything like ActiPro, and I was not able to get the AvalonDock controls to show up on the MSVC 2010 toolbar, so I am pretty much stuck using the default controls.
1). I have just tested the DockPanel and it does expand / shrink when the Window is resized - Have you removed the Grid that is placed in the Window by default in Visual Studio? If you mean it doesn't resize proportionally to the Windows size then i think you will need to use a Grid.
2). Again, list boxes work fine for me - Can you provide some more detail explaining why they don't work properly?
3). It depends on what you mean by "Grow upwards". If the top expander is closed, only the header will be displayed and the bottom expander will move up to take the space taken by the first expanders content (this is the default behaviour).
Do you have some XAML you can post as this will help identify your problems.