469,325 Members | 1,524 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,325 developers. It's quick & easy.

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 7577
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

Post your reply

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

Similar topics

6 posts views Thread by andrew.ames | last post: by
2 posts views Thread by Peter Oliphant | last post: by
6 posts views Thread by Miro | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.