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

trackBar Scroll value?

Hello,

I am using Visual C++ 2005 Express Beta 2 and cannot sort out how to
use the Scroll property value for a trackBar.


Under Event properties the name for the Scroll property is
trackBar1_Scroll so how do I print out the Scroll value?

I have tried using

Console::WriteLine(trackBar1_Scroll.Value);

but get error message

error C2228: left of '.Value' must have class/struct/union

if I use

Console::WriteLine(trackBar1_Scroll->Value);

I get

error C2228: left of '.Value' must have class/struct/union/generic
type

As you will see I do not know what I am doing! Any help would be much
appreciated. I have found 2 books but they are not published until
October/November. Any ideas for a good site which addresses this
language?

Cheers

Geoff
Nov 17 '05 #1
3 5380
Geoff Cox wrote:
I am using Visual C++ 2005 Express Beta 2 and cannot sort out how to
use the Scroll property value for a trackBar.


TrackBar has an event called Scroll. When you double click on it, the
IDE creates a member function for you, named trackBar1_Scroll. It's a
function, known as the event handler. Inside the body of the function
you write the code that need to be executed when the track bar's thumb
is moved.

Now you want to print the position of the track bar, which is accessed
via the track bar's Value property. The Value has nothing to do with
Scroll. Whether you scroll or not, the Value contains the current position.

So in the event handler type the following:

private: System::Void trackBar1_Scroll(System::Object^ sender,
System::EventArgs^ e)
{
Console::WriteLine(trackBar1->Value);
}

Hope this helps,
Tom
Nov 17 '05 #2
On Thu, 18 Aug 2005 12:21:37 -0700, Tamas Demjen <td*****@yahoo.com>
wrote:
Geoff Cox wrote:
I am using Visual C++ 2005 Express Beta 2 and cannot sort out how to
use the Scroll property value for a trackBar.
TrackBar has an event called Scroll. When you double click on it, the
IDE creates a member function for you, named trackBar1_Scroll. It's a
function, known as the event handler. Inside the body of the function
you write the code that need to be executed when the track bar's thumb
is moved.

Now you want to print the position of the track bar, which is accessed
via the track bar's Value property. The Value has nothing to do with
Scroll. Whether you scroll or not, the Value contains the current position.

So in the event handler type the following:

private: System::Void trackBar1_Scroll(System::Object^ sender,
System::EventArgs^ e)
{
Console::WriteLine(trackBar1->Value);
}

Hope this helps,


Tam,

I should have read this before posting my other message to you! I
understand why I must use trackBar1->Value - thanks for that.

I am trying to work out how to make a button invisible.

button1->Visible(false);

is not correct - hwo do I do this?

Cheers

Geoff



Tom


Nov 17 '05 #3
On Thu, 18 Aug 2005 20:49:06 +0100, Geoff Cox <> wrote:

I am trying to work out how to make a button invisible.

button1->Visible(false);
Solved!

button1->Visible = false;

Geoff




is not correct - hwo do I do this?

Cheers

Geoff



Tom


Nov 17 '05 #4

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

Similar topics

4
by: Bernie Yaeger | last post by:
I'd like to allow the user to zoom a window using a trackbar, say from 80% to 120% the size of the original window. I'm trying to do this with the following code, but it fails pretty miserably:...
2
by: Paul Helmuth | last post by:
All, I am trying to assess how much work it is going to be to "port" my current Visual Studio 6.0 applications to dotNet. It seems like many things that should be trivial are really...
0
by: deko | last post by:
I'm using VS05/.NET 2.0 with a TrackBar control in a Windows Forms application. I need to be able to manually scroll the trackbar (hold down left mouse button and drag), but I need to prevent...
1
by: Kris | last post by:
Hi. We are developing an application in VS2005 in C#, .NET, that has lots of tabs. On one of these tabs, there is a horizontal trackbar. However, we are unable to set the background color of the...
1
by: martins | last post by:
hi how can I configure/set the trackbar control in order to scroll between decimal values i.e. between 0.5 and 1 for example
2
by: mmdst23 | last post by:
I'm working on a video player app, and I want to implement a trackbar that behaves like the one in Media Player, that is the cursor position moves to where the user clicked instead of moving in...
2
by: John | last post by:
Ok, something that I thought would be easy is giving me fits. Using .NET 2.0 and C# I've added a Trackbar to a form. Set some values: trackVolume.Maximum = 100; trackVolume.Minimum = 0;...
0
by: tigger | last post by:
Hi there.. Regarding the button help i posted the last time, i already managed to do it.. Thanks.. But now, i'm having problems with trackbar.. I'm supposed to come up with a frequency trackbar that...
2
by: Piotrekk | last post by:
Hi. I have a trackbar. I need to set trackbar value depending on where user has clicked on the bar ( mouse_up event for example ). However avent arguments are telling me only about x and y...
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: 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
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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.