473,396 Members | 2,020 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,396 software developers and data experts.

visual basic: Public member 'ForeColor' on type 'String' not found

Hello, I want to change to forecolor of a label. The label is named
"lblDevice1"
I create a variable called Var

Dim Var
Var = "lblDevice1"

So the next step is:
Var.ForeColor = System.Drawing.Color.Green

--> Public member 'ForeColor' on type 'String' not found

How do I declare my variable the right way?

Best regards, Jurgen
Jul 21 '05 #1
2 3054

"Jurgen Oerlemans" <ju**************@envirolab.no_spam.nl> wrote in message
news:40**********************@news.wanadoo.nl...
Hello, I want to change to forecolor of a label. The label is named
"lblDevice1"
I create a variable called Var

Dim Var
Var = "lblDevice1"

So the next step is:
Var.ForeColor = System.Drawing.Color.Green

--> Public member 'ForeColor' on type 'String' not found

How do I declare my variable the right way?

Best regards, Jurgen

Why do you want to create a variable? Or, am I missing something?
You can change the foreground color directly:

lblDevice1.ForeColor = Color.(select from provided list)

--
Peter [MVP Visual Developer]
Jack of all trades, master of none.
Jul 21 '05 #2
I know I can change it directly,

But I do the same thing like 20 times. And not only for ForeColor, but also
on 2 other properties.
So I don't want to write 60 lines when it can be done in just a few

Jurgen

"Peter van der Goes" <p_**********@toadstool.u> schreef in bericht
news:ez**************@TK2MSFTNGP11.phx.gbl...

"Jurgen Oerlemans" <ju**************@envirolab.no_spam.nl> wrote in message news:40**********************@news.wanadoo.nl...
Hello, I want to change to forecolor of a label. The label is named
"lblDevice1"
I create a variable called Var

Dim Var
Var = "lblDevice1"

So the next step is:
Var.ForeColor = System.Drawing.Color.Green

--> Public member 'ForeColor' on type 'String' not found

How do I declare my variable the right way?

Best regards, Jurgen

Why do you want to create a variable? Or, am I missing something?
You can change the foreground color directly:

lblDevice1.ForeColor = Color.(select from provided list)

--
Peter [MVP Visual Developer]
Jack of all trades, master of none.

Jul 21 '05 #3

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

Similar topics

5
by: rettigcd | last post by:
I have several classes that all have the same static member: class A{ public static string Table = "TableA"; } class B{ public static string Table = "TableB"; }
4
by: DaHool | last post by:
Hi there !!! I browsed around the Internet in search for a solution of a little difficult problem i have in VB.NET.... However, i cannot find a suitable anwser anywhere, so i thought i'll give...
2
by: Jurgen Oerlemans | last post by:
Hello, I want to change to forecolor of a label. The label is named "lblDevice1" I create a variable called Var Dim Var Var = "lblDevice1" So the next step is: Var.ForeColor =...
1
by: JohnSmith | last post by:
I am working on a tuturial that i have for Visual basic.net ( for now ) I am working with Visual Studio 2005. I have been working on a code to change the text color by the name put into the...
7
by: jason | last post by:
In the microsoft starter kit Time Tracker application, the data access layer code consist of three cs files. DataAccessHelper.cs DataAcess.cs SQLDataAccessLayer.cs DataAcccessHelper appears...
3
by: Simon Hart | last post by:
Hi, I am trying to implement some functionality as seen in MS CRM 3.0 whereby a basic Xml is deserialized into an object which contains properties. What I want to do from here is; cast the basic...
1
by: John Kotuby | last post by:
Hi all, I have experienced several problems after installing SP1 for Visual Studio 2005 Professional. The problems are occurring on 2 different Windows XP SP2 development machines that have been...
2
by: Danielle | last post by:
All - Thanks in advance for any help you can provide. I've been working with a GridView in Visual Basic for a long time trying to get a list of contacts and to be able to edit and delete the...
2
by: Gillard | last post by:
hello I get a dll with standard call in C ++ but I really do not know how to use it in VB anyone can help??? there is the declarations in cpp to use the functions #ifndef SFPDF_H #define...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.