Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Image as property in class


  • Please log in to reply
2 replies to this topic

#1 jondeate

jondeate

    New Member

  • Members
  • Pip
  • 1 posts

Posted 07 February 2013 - 02:34 AM

Hello,
 
I am trying to set up an image as a property of my "Player" class, just so i can modify any new "Player" i create by its properties. 
 
 
This is kinda the code im using

 

imports system.drawingprivate mImage as Image public property Image as Image get  return mImage end get set (value as Image)  mImage = valuePlayerob.image = mImage 'Player ob is declared as picturebox somewhere else. end setend property 

 

 
 
Im asigning the variables 'linking' them to a new picturebox. Ex: Playerob.name = mName, Playerob.image = mImage... So any change that is make to the property modifies the picturebox itself.
 
Every single one of the properties but image works well whit this method im using. that means i can put
 
"Player1.Width = 20" and it works like a charm. But i cant modify the image and it doesnt even appear if i dont put this line of code
 

 

Playerob.image = mImage 'Player ob is declared as picturebox somewhere else. 

 

 
Into the function that creates the player.
 
Thank you all


#2 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 07 February 2013 - 11:16 AM

Hi Jondeate,

 

I'm not sure how this is relevant to Netduino, maybe just Visual Basic?


"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#3 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 07 February 2013 - 11:41 AM

Maybe try http://www.vbforums.com/ for generic VB.NET questions.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.