473,626 Members | 3,443 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_Scrol l so how do I print out the Scroll value?

I have tried using

Console::WriteL ine(trackBar1_S croll.Value);

but get error message

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

if I use

Console::WriteL ine(trackBar1_S croll->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 5395
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_Scrol l. 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_Scrol l(System::Objec t^ sender,
System::EventAr gs^ e)
{
Console::WriteL ine(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_Scrol l. 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_Scrol l(System::Objec t^ sender,
System::EventAr gs^ e)
{
Console::WriteL ine(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
3822
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: (from the form) Dim per As Decimal per = CDec(zoomit.Value) setzoom(Me, Me.Font, per) ' per is the current value of the trackbar as a
2
3545
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 problematic. I'm sure this mostly (but not completely) due to my lack of experience with dotNet. Anyway, the latest "trivial" issue concerns the Slider ActiveX control from
0
1779
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 automatic scrolling - that is, when a user clicks on the trackbar (on either side of the pointer) the pointer moves toward the clicked location. Is there anyway to disable this behavior?
1
7205
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 trackbar to trasparent. The best would by transparent . Becouse the tabs are gradiently colored. It should work on standard windows XP theme. In that, the color fades from RGB 252-252-254 to 244-243-238. Why VS2005 says that trasparent is...
1
10915
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
10171
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 that direction by a fixed value. Has anyone implemented something like this before? I haven't found anything on codeproject, or searching the .NET newsgroups. This seems like it would be a common control type, am I missing the easy solution? I...
2
18861
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; trackVolume.TickFrequence = 25; Then I added an event for the value:
0
1276
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 ranges from 250Hz-8kHz and display it on a label.. At 250Hz-1000Hz, it must increment by 250Hz. At 1000Hz-1500Hz, it must increment by 500Hz. And lastly, 2000Hz and above must increment by 1000Hz.. I can't get the tick frequency right.. This is the...
2
2716
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 position and so on... If i had hittest method i could try to work it out... Maybe you will know how to do described task? Regards PK
0
8268
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8510
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7199
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6125
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5575
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2628
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1812
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1512
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.