By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,968 Members | 1,589 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,968 IT Pros & Developers. It's quick & easy.

Invalid Use Of Property in User Control

lotus18
100+
P: 866
Hello World!

This is my very first time to create my own user control LOL. Can anyone improve this for me? And also I'm having trouble with LoadPicture function : ) tHANkS

Rey Sean
Attached Files
File Type: zip MyControl.zip (84.4 KB, 69 views)
Jan 16 '08 #1
Share this Question
Share on Google+
12 Replies


kadghar
Expert 100+
P: 1,295
Hello World!

This is my very first time to create my own user control LOL. Can anyone improve this for me? And also I'm having trouble with LoadPicture function : ) tHANkS

Rey Sean
what version of VB is the file for?
why dont you debug it and post the code that its giving you trouble?, i think that'll be easier and faster, and will allow people that doesnt have the version needed to help you.

(that was just a suggestion)
Jan 16 '08 #2

Expert 5K+
P: 8,434
Subscribing .
Jan 17 '08 #3

lotus18
100+
P: 866
Subscribing .
Hey Killer, have any idea?
Jan 17 '08 #4

QVeen72
Expert 100+
P: 1,445
Hi Lotus,

When you are using a Picture, You have to use all the 3 Properties :
Let, Get And Set
Add this property to your user Control :and your Picture problem will be solved:

Expand|Select|Wrap|Line Numbers
  1. Public Property Let Picture(ByVal New_Picture As StdPicture)
  2.     Set imgNormal.Picture = New_Picture
  3.     PropertyChanged "Picture"
  4. End Property
  5.  
Regards
Veena
Jan 17 '08 #5

lotus18
100+
P: 866
Hi Lotus,

When you are using a Picture, You have to use all the 3 Properties :
Let, Get And Set
Add this property to your user Control :and your Picture problem will be solved:

Expand|Select|Wrap|Line Numbers
  1. Public Property Let Picture(ByVal New_Picture As StdPicture)
  2.     Set imgNormal.Picture = New_Picture
  3.     PropertyChanged "Picture"
  4. End Property
  5.  
Regards
Veena
Hi Veena

Thanks for responding. I'll try that later. : )

Rey Sean
Jan 17 '08 #6

lotus18
100+
P: 866
Hi Veena

Thanks for responding. I'll try that later. : )

Rey Sean
Thanks Veena. It worked!
Jan 19 '08 #7

Expert 5K+
P: 8,434
Glad to see you got it sorted. Thanks for that, Veena.

Sorry lotus18, I subscribed so I could get back to this thread, but haven't had the time.
Jan 20 '08 #8

lotus18
100+
P: 866
Glad to see you got it sorted. Thanks for that, Veena.

Sorry lotus18, I subscribed so I could get back to this thread, but haven't had the time.
Hey Killer42 any suggestions for my control? I know it looks so simple, would you like to improve this one for me? LOL ^ ^

Rey Sean
Jan 21 '08 #9

Expert 5K+
P: 8,434
Hey Killer42 any suggestions for my control? I know it looks so simple, would you like to improve this one for me? LOL ^ ^
Just leaving work now. I'll try to have a look at it tonight at home.

I've only created a couple of fairly simple user controls, myself. Mostly just to try it out. I'll try to track down a funny one and post it - it's basically just a picturebox with coloured dots bouncing around in it.
Jan 21 '08 #10

lotus18
100+
P: 866
Just leaving work now. I'll try to have a look at it tonight at home.

I've only created a couple of fairly simple user controls, myself. Mostly just to try it out. I'll try to track down a funny one and post it - it's basically just a picturebox with coloured dots bouncing around in it.
I'll watch for it : )

Rey Sean
Jan 21 '08 #11

Expert 5K+
P: 8,434
I'll watch for it : )
Sorry, got pretty busy. Hopefully tonight.
Jan 21 '08 #12

Expert 5K+
P: 8,434
I did find this cute little one. Just add the user control file to your project, place one on a new form, and add this code in the form...
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Resize()
  2.   Tailer1.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight
  3. End Sub
This is not really necessary, of course - it's just to keep it the same size as the form.

I couldn't post the source of the user control, TheScripts kept spitting the dummy for some reason. Too long, I guess, even though I chopped it into chunks. So I'll put it in a zip file.

Tip: Check out the Style (and possibly TailLength) property. It looks as though only styles "Dot trail", "Bubbles" and "Smoke" are working.
Attached Files
File Type: zip Tailer - source.zip (9.0 KB, 44 views)
Jan 22 '08 #13

Post your reply

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