Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm designing a silverlight application for showing sheet music from a midi file.

I want to create a horizontally scrolling musical staff.

At my job I maintain a winforms application that is a scrolling Gantt chart of airplane schedules, and it basically has a rows collection, and it maps the left-most pixel and right-most pixels of the control to datetimes. Then the paint method loops through what it determines will be the visible rows, and draws a screen that shows the schedule information between the two dates.

Would I be correct in assuming that I would need to something similar in silverlight for my sheetmusic, or would it be better to just create a horizontal scrollviewer containing a canvas that I have drawn programmaticially on.

Am I headed in the right direction? I havent seen any articles on designing such a custom control: can you point me at any?

share|improve this question
up vote 1 down vote accepted

It think your second idea - that of a horizontal scroll viewer is the "better" one.

With Silverlight, unless you get into the really low level drawing of 3D elements, you don't need (or indeed have) the same concept as a "paint" method.

It might even be worth looking at a horizontal StackPanel with a background image of the staves. Then each element in the panel could be a note (or a collection of notes) that would draw themselves.

share|improve this answer
Thanks for the advice, Chris! – Rick Hodder Nov 6 '12 at 15:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.