| View previous topic :: View next topic |
| Author |
Message |
timmy Newbie
Joined: 08 Dec 2003 Posts: 5
|
Posted: Jan 12th, 2004 01:05 PM Post subject: Declare image as constant |
|
|
I am having a world of troubles, trying to declare an image as a constant. I've been trying something along the lines of:
Const imgon=frmgame.imglight(index).Picture=LoadPicture("lighton.gif")
Anyone have ideas of how I'd do this? |
|
| Back to top |
|
P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Jan 12th, 2004 04:16 PM Post subject: |
|
|
A constant is something that can't change... Using a property of a control is therefore not possible (I think)... There might be another way for what you are trying to do... Why is this needed? _________________ No one is completely useless. They can at least be an example of what to avoid. |
|
| Back to top |
|
timmy Newbie
Joined: 08 Dec 2003 Posts: 5
|
Posted: Jan 12th, 2004 04:51 PM Post subject: |
|
|
| I'm using it for a Lights Out program I have to make for my final program in class. I didn't want to have to have an array for when the lights were on, and one for when they were off, so I wanted to make an integer that equaled the on or off picture. I got it figured out though, thanks all. |
|
| Back to top |
|
P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Jan 12th, 2004 05:48 PM Post subject: |
|
|
What did you do after all? If you read the file as binary and set that data as your constant you can afterwards write that data to a temp file and use that... _________________ No one is completely useless. They can at least be an example of what to avoid. |
|
| Back to top |
|
timmy Newbie
Joined: 08 Dec 2003 Posts: 5
|
Posted: Jan 14th, 2004 12:03 PM Post subject: |
|
|
I ended up having to add the following code to my program...
Public Const lighton = "lighton.gif"
Public strimage As String
strimage = App.Path & "\Pics\"
And I referred to it like this...
frmgame.imglight(x).Picture = LoadPicture(strimage & lighton)
I also had to use Tags |
|
| Back to top |
|
P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Jan 14th, 2004 12:26 PM Post subject: |
|
|
Why did you need the tags? It works the way it is now... _________________ No one is completely useless. They can at least be an example of what to avoid. |
|
| Back to top |
|
|