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

Changing label font size in visual basic 6.0

Create a font size increment application that displays Size in label and increases the font size of the label in intervals of 5 starting at size 10 and ending at size 50.

Here is my code:
Dim intCount As Integer, intStart As Integer, intEnd As Integer
Dim intStep As Integer
Dim intSize As Integer

intStart = lblSize.Font.Size = 10
intEnd = lblSize.Font.Size = 50
intStep = lblSize.Font.Size = 5


For intCount = intStart To intEnd Step intStep
intSize = intSize + intCount
Next intCount

lblSize.Font.Size = intCount

However, when I run this applicaton my computer freezes and ends up crashing...how can i fix this? Thanks!
Dec 17 '11 #1
1 9221
Killer42
8,435 Expert 8TB
I'd suggest you use VB's excellent debugging tools to interrupt this code as soon as it starts, and examine the values that you're placing in each variable.

In my opinion, what you're actually placing in intStart, intEnd and intStep is either True (-1) or False (0). If we take this statement for example...
Expand|Select|Wrap|Line Numbers
  1. intStart = lblSize.Font.Size = 10
what you're assigning to intStart is the result of the comparison operation lblSize.Font.Size = 10. This will be either True or False, depending on whether the font size is 10.
Dec 18 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Kerberos | last post by:
I have looked on Google for a solution to change CSS properties of several CSS elements of a page. All solutions I have found are server-side solutions with cookies. What I'm looking for is a...
5
by: dixie | last post by:
I want to be able to set the font size and font type for text in a text box on a report using VBA. I wan't to be able to control it from a setting in a table. The problem is that I don't know the...
6
by: Andreas Klemt | last post by:
Hello, when I use <asp:label font-size="16px" text="Hello World" runat="server" /> and run FireFox Browser the output of "Hello World" is not in Size 16px. The size will be ignored and I can...
18
by: Diogenes | last post by:
Hi All; I, like others, have been frustrated with designing forms that look and flow the same in both IE and Firefox. They simply did not scale the same. I have discovered, to my chagrin,...
1
by: deanh | last post by:
I would like to know how to change the FontSize when printing to a file using "Print #1, " . When printing to paper, I use Printer.Print FontSize = 12, but don't know how to do it when printing to...
6
by: andrew.ames | last post by:
Hi I have a pretty basic windows application created in Visual Studio 2005 and VB.NET. I set my Form's font to Arial 8.25pt, so when i added a label and a button they automatically have a...
2
by: Peter Oliphant | last post by:
I can read the Font^ of a Button(->Font). But how do I change the Font of a Button, or at least it's size? I'm programming using MS VC++ 2005 Express in /clr managed mode. Thanks!
5
by: Mike | last post by:
I am trying to set the font size on a Label control. Seems like a simple item but I can't find a way to do it. I can set other properties for a Label like Borderstyle, BackColor, Fontstyle=BOLD...
6
by: Miro | last post by:
Is there a way to / or a mathematical formula to see if a font size is 'too big' for a label. I have a label that is docked to 'fill' a form, and I want to resize that font based on the width...
2
by: jkizmannRU09 | last post by:
I know how to adjust the look of visited links with a CSS stylesheet, but how would one create individual variations among a set of links? For example, say I have three links, all initially...
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: 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
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
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.