Note that there are some explanatory texts on larger screens.

plurals
  1. POCan I set to ScrollBar a floating Step?
    primarykey
    data
    text
    <p>I have a panel in witch I represent a timeline - 24 hours(<code>24 x 60 min = 1 440 min</code>). </p> <p>I need to set my scroll bar's step to a minute. It's evident that minimum size of such a panel should be <code>1440</code> pixels.</p> <p>Let's say the screen resolution on the client screen (width) is <code>1280</code>, so say panel container max size is 1280. Now, if I want my step be a minute I need to set the step to the scrollbar's container to <code>1280 / 1440 = 0.(8)</code> - but it's impossible, cause the Step (myContainer.HorizontalScroll.SmallChange) is an <code>int</code> value... </p> <p>Can I do something to this?</p> <p><strong>EDIT</strong></p> <p>Maybe 0.2 pixel per minute can be considered a inobservable error, but if my step will be 5 minutes, it will in reality be 4.(4)px but in scrollbar = 5, a step of 10 minutes will be = 8.(8)px : 10px. On a 800x600 screen the 10min step will be = 5.(5)px : 10px, so in each 2 clicks(20 min) I have 4 pixel error. This "delta" became visible.</p> <p>Finally, this is a sample, that <strong>DOES NOT work</strong> - even if I arrive to make the scrollbar visible - strange scrollbar visibility is unpredictable... - I can't scroll all the VOLVO logo in 6 (60Maxim/10smallChange) steps...:</p> <p><a href="http://lh6.ggpht.com/_1TPOP7DzY1E/S1eOPUlVvQI/AAAAAAAAC8M/ZFWDI_aaJxI/s800/panels.png" rel="nofollow noreferrer">alt text http://lh6.ggpht.com/_1TPOP7DzY1E/S1eOPUlVvQI/AAAAAAAAC8M/ZFWDI_aaJxI/s800/panels.png</a></p> <p>Designer:</p> <pre><code>this.panel2.BackgroundImage = ....Resources.volvo_logo; this.panel2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; </code></pre> <p>Code:</p> <pre><code>public partial class Form1 : Form { private System.Windows.Forms.Button button1; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel2; public Form1() { InitializeComponent(); panel1.AutoScroll = false; panel1.HorizontalScroll.Maximum = 60; panel1.HorizontalScroll.SmallChange = 10; panel1.HorizontalScroll.LargeChange = 10; panel1.HorizontalScroll.Visible = true; panel1.Scroll += new ScrollEventHandler(panel1_Scroll); } void panel1_Scroll(object sender, ScrollEventArgs e) { Console.WriteLine( "Scroll: OldVal {0}, NewVal {1}, Orientation {2}, Type {3}", e.OldValue, e.NewValue, e.ScrollOrientation, e.Type); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload