473,387 Members | 1,504 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,387 software developers and data experts.

scrollbar thumbtrack woes

I am having some issues with the standard Windows scrollbar. I am using MS
Visual Studio 2005. Code is C#. The application is a Windows Forms app. The
tool is a vertical scroll bar from the toolbox.

I am attempting to perform a simple operation on a global class variable
(not a methods local variable) such as an integer increment (like myInt++ ).
Grabbing the scroll bar and dragging it produces the thumbtrack event in the
scroll method. I notice that if I grab the scroll bar and drag it down
quickly, the variable is only incremented occasionally. If I drag it slowly
enough, the variable is incremented correctly.

The scroll method seems to be called, but the variable is not updated. The
other scroll events ( SmallIncrement, SmallDecrement etc) are slow enough to
allow the variable to be updated correctly.

How can I get the variable to be updated each time the scroll thumbtrack
event fires???

Here's the code to reproduce the problem. Very simple.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace scrollbar
{
public partial class Form1 : Form
{
int myInt = 0;

public Form1()
{
InitializeComponent();
}

private void vScrollBar1_Scroll(object sender, ScrollEventArgs e)
{
if (e.Type == ScrollEventType.ThumbTrack)
{
myInt++;
textBox1.Text = Convert.ToString(myInt);
}
} // end method
} // end class
} // end namespace

--
Sam
May 22 '07 #1
0 1248

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Sujan | last post by:
Hello all, Is it possible to remove scrollbar(s) without using frames. Is there any code which could be applied in body tag to remove scrollbar(s). Thanks in adv, Sujan
4
by: Price Brattin | last post by:
I dragged a datagrid onto a VB.Net WinForm and used the properties page and a few lines of code to set it up, including the DataSource. No wizard setup was used. It works fine except for one...
9
by: kjs | last post by:
Is there any was to control the color of the scrollbars when using the 'overflow: scroll' attribute? TIA, Karl
0
by: h-h | last post by:
BODY { scrollbar-face-color: #f5f5f5; scrollbar-highlight-color: #666666; scrollbar-shadow-color: #666666; scrollbar-3dlight-color: #ffffff; scrollbar-arrow-color: #666666;...
1
by: Shun | last post by:
Hello, How to the add a blue color scrollbar to the browser Left and bottom. Thanx Shun
1
by: Umesh | last post by:
Hi, In VC++ , I want to Handle ThumbTrack Notification for, Multiline Edit Control with scroll bars . I have handled EN_VSCROLL notification but I could only handle Up & Down arrow key press...
2
by: kurt sune | last post by:
How do I render the scrollbars by CSS in a listbox? I have understood that an asp listbox gets rendered as a select element. So I tried first by adding a style element: ..TA...
3
by: nicky77 | last post by:
Hi, before you say it i know frames are bad practice - but i'm developing dynamic content on a site which has already been designed, so alas there's no option but to use them. Anyway, I just want to...
1
by: Tom | last post by:
First, I posted a similar request for help in another group and now don't find the posting. Problem with my newsreader perhaps ... but apologies if this appears as a cross posting. My code is...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.