c# - Using Scroll Bar to Shift Text in a Label -
i have label contains string larger label. have created label no text made represent scroll bar, , have set label moves on x axis mouse follows:
private point mousedownlocation; private void move(object sender, mouseeventargs e) { if (e.button == system.windows.forms.mousebuttons.left) { mousedownlocation = e.location; } } private void movex(object sender, mouseeventargs e) { if (e.button == system.windows.forms.mousebuttons.left) { if (e.x + scrollbar.left - mousedownlocation.x > 34 && e.x + scrollbar.left - mousedownlocation.x + scrollbar.width < button1.location.x - 10) { scrollbar.left = e.x + scrollbar.left - mousedownlocation.x; } } }
the reason have done merely synthetic purposes. problem cannot find way shift text within label amount scroll bar has shifted looks scrolling through text in label. keep in mind label cannot multiline. in advance.