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

Drawing controls question

This should be an easy question, but I have not found the answer. I am now
learning how to create my own controls and draw them to a form. But my
specific question is when I have a label that I want to BOLD, how do I set
the label text to be bold?

Thanks for the information.
Nov 21 '05 #1
3 1010
"Brad" <ba******@ukcdogs.com> schrieb:
learning how to create my own controls and draw them to a form. But my
specific question is when I have a label that I want to BOLD, how do I set
the label text to be bold?


\\\

' Adding bold style.
Me.Label1.Font = _
New Font(Me.Button1.Font, Me.Label1.Font.Style And Not FontStyle.Bold)

' Removing bold style.
Me.Label1.Font = _
New Font(Me.Button1.Font, Me.Label1.Font.Style Or FontStyle.Bold)
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #2
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:eZ*************@TK2MSFTNGP09.phx.gbl...
"Brad" <ba******@ukcdogs.com> schrieb:

.. . .
how do I set the label text to be bold?


' Adding bold style.
Me.Label1.Font = _
New Font(Me.Button1.Font, Me.Label1.Font.Style And Not FontStyle.Bold)

' Removing bold style.
Me.Label1.Font = _
New Font(Me.Button1.Font, Me.Label1.Font.Style Or FontStyle.Bold)


Should that not be the other way around??

Adding :
.... New Font( ... Font.Style Or FontStyle.Bold )

Removing :
.... New Font( ... Font.Style And Not FontStyle.Bold )

Regards,
Phill W.
Nov 21 '05 #3
"Phill. W" <P.A.Ward@o-p-e-n-.-a-c-.-u-k> schrieb:
> how do I set the label text to be bold?


' Adding bold style.
Me.Label1.Font = _
New Font(Me.Button1.Font, Me.Label1.Font.Style And Not
FontStyle.Bold)

' Removing bold style.
Me.Label1.Font = _
New Font(Me.Button1.Font, Me.Label1.Font.Style Or FontStyle.Bold)


Should that not be the other way around??


Yes, it should. Thank you for the correction!

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #4

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

Similar topics

3
by: Steve | last post by:
Hi all I am using the following code to draw strings onto a Form: ---------------------------- Dim tabGraphics As System.Drawing.Graphics = Me.CreateGraphics() Dim labelFont As New...
2
by: Champika Nirosh | last post by:
Hi, I want to create drawing board application that can draw Line, rectagle, circle and free hand drawing. Each drawing need to be transparent, moveable (draggable), have bring to front and...
1
by: Hadar | last post by:
Hi, I'm getting "object is currently in use elsewhere" when I use System.Drawing.Graphics.MesureString. This is what I do: My controls use a utility class the helps it to mesure strings. To...
2
by: MenuChen | last post by:
This Code doesn't work ************************ Protected Overrides Sub WndProc(ByRef m As Message) MyBase.WndProc(m) Dim myLine As Graphics = System.Drawing.Graphics.FromHwnd(Me.Handle)...
4
by: Billy Bob | last post by:
Hi, Is it possible like Visual Basic that when you are in Design mode so you can add controls etc to a windows form that you can draw on it? like draw a line or a shape? Bob *** Sent via...
9
by: davetelling | last post by:
I am not a programmer, I'm an engineer trying to make an interface to a product I'm designing. I have used C# to make a form that interrogates the unit via the serial port and receives the data. I...
3
by: kamleshgk | last post by:
Hi, I have a requirement to draw a rectangle and a line on a the container control and sometimes as i move the mouse the drawing must occur on top of user controls and other controls, which are...
0
by: Olie | last post by:
I am writting a program that uses allot of images to build up the form. It has quite allot of fader and LED controls which update live. Originally the problem I had was that it would take ages to...
2
by: Nathan Sokalski | last post by:
I am attempting to create icons for controls I have created using VB.NET by using the System.Drawing.ToolboxBitmap attribute. I have managed to do this in C# by specifying the path to the *.ico...
7
by: raylopez99 | last post by:
I have a logical drawing space much bigger than the viewport (the screen) and I'd like to center the viewport (the screen) to be at the center of the logical drawing space. After following the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
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,...
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.