473,386 Members | 1,924 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to create scrollable WPF Canvas into WPF ScrollViewer

Hello.
My name is Eugene Buzin. First, I bag your pardon for my poor English. I appeal to you for help at first. I'm a C#-programmer from Russia and beginner in WPF. Now I'm developing WPF application that must contain scrollable WPF Canvas in WPF ScrollViewer. Could you help me and give me a source code of WPF window application of this type? I'll be very grateful to you for your help.

Very truly yours Eugene Buzin.
Nov 3 '11 #1

✓ answered by Frinavale

I'm not sure what you're having problems with specifically but all you have to do is add a ScrollViewer, set it's height and width to something and then add a Canvas with a set height and width that is larger than the ScrollViewer's.

For example:
Expand|Select|Wrap|Line Numbers
  1. <ScrollViewer Height="200" Width="400" HorizontalScrollBarVisibility="Visible">
  2.   <Canvas Height="800" Width="800" Background="Beige"/>
  3. </ScrollViewer>
-Frinny

2 19629
Frinavale
9,735 Expert Mod 8TB
I'm not sure what you're having problems with specifically but all you have to do is add a ScrollViewer, set it's height and width to something and then add a Canvas with a set height and width that is larger than the ScrollViewer's.

For example:
Expand|Select|Wrap|Line Numbers
  1. <ScrollViewer Height="200" Width="400" HorizontalScrollBarVisibility="Visible">
  2.   <Canvas Height="800" Width="800" Background="Beige"/>
  3. </ScrollViewer>
-Frinny
Nov 3 '11 #2
Thank you very much, Frinavale. I'll try to do accordingly your advice. Simply I'm gathering skills in WPF while I'm developing my application and sometime encountering questions. Thanks.

Very truly yours Eugene Buzin.
Nov 4 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Mickel Grönroos | last post by:
Hi, I have a Tkinter.Canvas of variable width. Is there a standard way of asking the canvas which parts of it that is visible? I.e. on the horizontal scale, I would like to know at what fraction...
2
by: Askari | last post by:
Hi, I do a "perso"widget where have two scrolls (one vertical, one horizontal) for a canvas. When, the first time, I added widget in the canvas, the scroll self-ajust and when I move scrollbar,...
0
by: dave | last post by:
here is a simple solution to creating a table whose headers are fixed and whose body scrolls. tested with IE6 and firefox 1.0. the results vary very subtly, but achieve the same operational effect....
0
by: Suresh Kojhani | last post by:
Hi Dear any one know how can we create scrollable panel in asp.net..if any one know then tell me how can i create than one. Suresh Kumar Software Developer Infinilogic (Pvt.) LTD Karachi...
1
by: Eric Wong | last post by:
Using Tkinter, I have a Canvas with vertical Scrollbar attached. At runtime, I dynamically create Checkboxes on the Canvas, each one on a different row. When I add a lot of Checkboxes, instead of...
6
by: Nebulism | last post by:
I have been attempting to utilize a draw command script that loads a canvas, and through certain mouse events, draws rectangles. The original code is from...
4
by: crazychrisy54 | last post by:
Hi there, I am new to JavaScript and wonder if it could be used to solve my problem, any help would be much appreciated! I have a html web page which contains a table on the left hand side and...
4
by: moondaddy | last post by:
I have a wpf project where I use a canvas to drag shapes around. when I drag a shape beyond the right or bottom side I get scrollbars which is good. I also get scrollbars when I zoom in and a...
7
by: Haiyan | last post by:
Dear experts: I am trying to add one xy-scrollbar on the canvas, then put lots of check buttons on the canvas. I got at least following 2 problems: 1.I can see the y-scroll bar but contents on...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.