General Development

Underlining text in VB.NET – DeathFox

DeathFox
Member

Posts: 57
From:
Registered: 04-25-2006
How Do I turn on/off the Underline Effect on a certain object?
I tried the object.FONT.UNDERLINE but that function only gets a boolean value, not set. Someone plz help
kenman

Member

Posts: 518
From: Janesville WI
Registered: 08-31-2006
I've been looking for the solution since you posted, and I can't find an easy one. The .underline function is reserved to tell you if an object is underlined or not.

possible solutions:

2 identical objects in the same position, toggle visibility based on being underlined or not. This would be an easy solution if you are looking at one or two items to toggle, but not effective if you have a great deal.

destroying and creating new object each time, with property changes

or if you are just looking to highlight a selected entry, try .backcolor changes to highlight selections.

Hope this has been somewhat helpfull

DeathFox
Member

Posts: 57
From:
Registered: 04-25-2006
Thanks. But I just used a button and disguised it as a line and use simple resizing/location commands to underline any texboxes
SSquared

Member

Posts: 654
From: Pacific Northwest
Registered: 03-22-2005
The Font class in .NET does not allow changes. You need to create a separate Font object (with underline) and then set this to the Font property of your object. Likewise, to remove the underline will require another Font object without the underline set.

I don't know VB, so I am not sure if my terminology is correct in a VB app.