Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 1st, 2004, 02:56 PM
Newman_SCO Newman_SCO is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 28 Newman_SCO User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 51 m
Reputation Power: 0
Arrow Resizing a label? at runtime

Hello,

I have had no luck in finding code which can resize a label when the program is running. Using resizing arrows at the edge of the label. So I can change the size of the label to fit my needs.

Is this possible?

I have looked over alot of websites and cannot find a solution or tutorial.


If it is possible could you possibly give me some pointers or snippets of code.

(It has a border around a label. So it is easily seen.)

Thanks In advance

Reply With Quote
  #2  
Old February 1st, 2004, 03:01 PM
minor28 minor28 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Sweden
Posts: 245 minor28 User rank is Sergeant (500 - 2000 Reputation Level)minor28 User rank is Sergeant (500 - 2000 Reputation Level)minor28 User rank is Sergeant (500 - 2000 Reputation Level)minor28 User rank is Sergeant (500 - 2000 Reputation Level)minor28 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 h 6 m 11 sec
Reputation Power: 14
Do you mean something else than setting the label property AutoSize to True

Reply With Quote
  #3  
Old February 1st, 2004, 03:41 PM
Newman_SCO Newman_SCO is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 28 Newman_SCO User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 51 m
Reputation Power: 0
Sorry for not being clear enough.

If I was to start the program, I want the ability of taking an edge of the label with the mouse and resizing the label to a smaller or larger size of my choice.

Whenever you release the mouse it keeps the set size.

Reply With Quote
  #4  
Old February 1st, 2004, 04:26 PM
minor28 minor28 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Sweden
Posts: 245 minor28 User rank is Sergeant (500 - 2000 Reputation Level)minor28 User rank is Sergeant (500 - 2000 Reputation Level)minor28 User rank is Sergeant (500 - 2000 Reputation Level)minor28 User rank is Sergeant (500 - 2000 Reputation Level)minor28 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 h 6 m 11 sec
Reputation Power: 14
I don't think there is such a feature in a label. But you can try the mouse events for the label
Code:
Private Sub Label1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Private Sub Label1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)

Reply With Quote
  #5  
Old February 1st, 2004, 04:55 PM
Newman_SCO Newman_SCO is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 28 Newman_SCO User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 51 m
Reputation Power: 0
Thanks minor28 anyway.

I had a look at creating something out of the sub titles that you suggested.

I tried.
But I am just not experienced enough.


I will find another way round my problem. But will be much more time consuming.

If anyone can help me please drop a post.

Thanks

Reply With Quote
  #6  
Old February 1st, 2004, 05:04 PM
minor28 minor28 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Sweden
Posts: 245 minor28 User rank is Sergeant (500 - 2000 Reputation Level)minor28 User rank is Sergeant (500 - 2000 Reputation Level)minor28 User rank is Sergeant (500 - 2000 Reputation Level)minor28 User rank is Sergeant (500 - 2000 Reputation Level)minor28 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 h 6 m 11 sec
Reputation Power: 14
I don't know another way round your problem. Don't give up. To start with you can change the mousepointer with this code example.
Code:
Private Sub Label1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Screen.MousePointer = vbSizeNWSE
End Sub

Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Y = 0 And X = Label1.Width / 2 Then Screen.MousePointer = vbSizeNS
End Sub

Private Sub Label1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Screen.MousePointer = vbDefault
End Sub

You have the pointer coordinates, you have the label position, height and width. When mousepointer is out of label control you have the same events for the form.

Reply With Quote
  #7  
Old February 1st, 2004, 06:20 PM
Newman_SCO Newman_SCO is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 28 Newman_SCO User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 51 m
Reputation Power: 0
Been scratching my head for a while.

I still can't find anything to do with it on google.


Your suggestion is a great starting point. Exactly the characteristics of what I need!



I have been typing up some ideas but all seem to make no sense lol. I Will keep trying.

Reply With Quote
  #8  
Old February 2nd, 2004, 03:31 AM
minor28 minor28 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Sweden
Posts: 245 minor28 User rank is Sergeant (500 - 2000 Reputation Level)minor28 User rank is Sergeant (500 - 2000 Reputation Level)minor28 User rank is Sergeant (500 - 2000 Reputation Level)minor28 User rank is Sergeant (500 - 2000 Reputation Level)minor28 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 h 6 m 11 sec
Reputation Power: 14
You should post your ideas. OK, I give you some more
Code:
Dim fmouse As Boolean

Private Sub Label1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
    fmouse = True
End Sub

Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
    If fmouse = True Then
        Screen.MousePointer = vbSizeNWSE
        Label1.Width = x
        Label1.Height = y
    End If
End Sub

Private Sub Label1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
    If fmouse = True Then
        fmouse = False
        Screen.MousePointer = vbDefault
    End If
End Sub

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Resizing a label? at runtime


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT