Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> A Few Questions, Please help
Aequitas619
post Apr 29 2007, 06:11 PM
Post #1


Advanced Member
Group Icon

Group: Members
Posts: 101
Joined: 14-November 06
Member No.: 17,255



Hi everyone. I have a few questions about Visual Basic.Net. Its nothing complex, just a few problems with syntax!

1. First, how do you change a labels text color? I have tried messing around with forecolor etc but cant quite seem to get it right!

2. Also, Id like to put a return in a label to use multiple lines of text. Something like <br> from html

3. How do I include other classes? Do I use inherit?

4. Lastly, how do I include math functions? Something like #include <math.css> from CPP

Thanks in advance for the help!
Go to the top of the page
 
+Quote Post
faulty.lee
post Apr 30 2007, 01:12 AM
Post #2


Premium Member
Group Icon

Group: [HOSTED]
Posts: 495
Joined: 5-November 06
Member No.: 17,016



QUOTE(Aequitas619 @ Apr 30 2007, 02:11 AM) *
Hi everyone. I have a few questions about Visual Basic.Net. Its nothing complex, just a few problems with syntax!

1. First, how do you change a labels text color? I have tried messing around with forecolor etc but cant quite seem to get it right!

2. Also, Id like to put a return in a label to use multiple lines of text. Something like <br> from html

3. How do I include other classes? Do I use inherit?

4. Lastly, how do I include math functions? Something like #include <math.css> from CPP

Thanks in advance for the help!


1. Forecolor is the one. I don't see why you can't.

2. Label is auto wrapping. A workaround is to use TextBox as label. Turn on Multiline, make it ReadOnly and change the cursor to Default instead of IBeam, and border to None. It should look quite like a label.

3. There's no need to include in the code. If that file is not in your project, just add it in, or link (Click the down arrow in the open file dialog, and select Link File). And that class you need should be Public, then you can just access it from any other class or module you have.

4. Math function is built it, unless you're talking about advance or complex one, which normally comes as an additional class(.vb) or library(.dll). For class, just refer to step 3. For library, you need to add it as reference
Go to the top of the page
 
+Quote Post
dhanesh
post Apr 30 2007, 04:49 PM
Post #3


Binary Geek
Group Icon

Group: Members
Posts: 444
Joined: 4-November 05
From: The Digital Arena
Member No.: 9,440



QUOTE(Aequitas619 @ Apr 29 2007, 10:11 PM) *
1. First, how do you change a labels text color? I have tried messing around with forecolor etc but cant quite seem to get it right!

2. Also, Id like to put a return in a label to use multiple lines of text. Something like <br> from html

1. Try this .. Double click the label and write the code .. label1.text = red (change the color or use the color with ' like 'red') see if that helps. Else try label1.color = red .. I dont have my laptop so cant try it out, but m shure one of these combinations will also do the trick.

2. Doesnt \n work ? Never really needed a new line in the labels so this is a shot in the dark.

Regards
Dhanesh.
Go to the top of the page
 
+Quote Post
tansqrx
post May 20 2007, 06:12 AM
Post #4


Super Member
Group Icon

Group: [HOSTED]
Posts: 533
Joined: 25-April 05
Member No.: 4,374



It looks like this has mostly already been answered but I figured I would throw a little bit more on it.

1. Label1.ForeColor = Color.Aqua as an example.
2. Label2.Text = "First line" + vbCrLf + "Second line"

The secret here is the vbCrLf (carriage return, line feed). One of my first problems in VB was finding the “/n” which this is it. Another way is to use Environment.NewLine. I think this is the perfered Microsoft way as this will be compatible across all platforms but I have never had any problems with vbCrLf.

3. The way to inherit is to use the inherit keyword directly after the class definition. From my experience you should not have to use this very often. When I do it is usually creating a user defined control that is derived from a similar control. For example, a text box that already has a particular phrase in it.
4. As said before most of the basics are built in. For some of the more exotic function you can use “Imports System.Math”.
Go to the top of the page
 
+Quote Post
Feussy
post Jun 25 2007, 01:40 AM
Post #5


Newbie [ Level 2 ]
Group Icon

Group: Members
Posts: 10
Joined: 25-June 07
Member No.: 22,900



From what I remember about editing graphics, all objects have a backcolor option. Set this with either Color.*, with * being a color, or use the hex equivalent of that color. For your new line issue, input your label text and insert Chr(13) where you want your new line inserted.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Python(5)
  2. Half-life 2 Questions(12)
  3. Runescape(73)
  4. Mp3 Questions(14)
  5. How Search Engines Operate(6)
  6. Programing Windows Joystick(2)
  7. Interesting Science Questions(13)
  8. Just Got A New Laptop....(13)
  9. Questions On Islam(10)
  10. Asterisknow Pbx (voip Telephony)(1)
  11. Some More Questions About Credits And Forum(8)
  12. Adsense(3)
  13. Quite A Few Questions...(3)
  14. Some Questions About Your Computer Usage(7)
  15. Advanced Network Questions(3)
  1. Questions(3)
  2. Smf - Simple Setup Questions(10)
  3. Does Science Answer All Our Questions?(13)
  4. Why Should I Buy A Mac?(22)
  5. Rpg Maker Xp Questions(1)
  6. I Am New And Have Some Questions(6)
  7. Programming C In Windows(8)
  8. Replicator Technology(0)
  9. Xampp And Wampp Questions(7)
  10. New Here, Read Some Other Posts...(1)
  11. Mysql With My Own Server(4)
  12. Some Php Questions(8)
  13. String Library Functions(4)


 



- Lo-Fi Version Time is now: 11th October 2008 - 08:20 PM