473,406 Members | 2,619 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

how to switch between picture boxes by the name ?

8
we have two picture boxes by names of "pic1" and "pic2"
we want to maintain parameters "isize" and "jsize" with parameter "picnum".
the code dosent work whats the problem?
Expand|Select|Wrap|Line Numbers
  1. dim picnum as string
  2. if a=1 then
  3. picnum=pic1
  4. else 
  5. picnum=pic2
  6. end if
  7.  
  8. With picnum
  9. isize = .Height
  10. jsize = .Width
  11. end with
  12.  
Feb 17 '11 #1
3 2033
Guido Geurs
767 Expert 512MB
The default property for "pic1" and "pic2" is the picture of the box.
so you can't set a var "picnum" (that by the way a string ??? is and not an integer) can't contain a picture.
How can "picnum" (a string) have a .width and .height ???

Suggestion: always set the properties like:
Picture1.picture
Text1.text
....
Feb 17 '11 #2
sbtunx
8
thank you but "pic1" and "pic2" are the "name property" of every picture box not the name of picturs. and yes i dont know really what should be "picnum" a string ...an object...or other. i will thank you more if you modify this code
Feb 17 '11 #3
Guido Geurs
767 Expert 512MB
This is the code for placing the width and height of 2 pictures in a label via a var PICNUM:
Expand|Select|Wrap|Line Numbers
  1. Private Sub ComPic1_Click()
  2. Dim PICNUM As StdPicture
  3.    Set PICNUM = Picture1.Picture
  4.    LabelWidth.Caption = "Width = " & PICNUM.Width
  5.    LabelHeight.Caption = "Height = " & PICNUM.Height
  6. End Sub
  7.  
  8. Private Sub ComPic2_Click()
  9. Dim PICNUM As StdPicture
  10.    Set PICNUM = Picture2.Picture
  11.    LabelWidth.Caption = "Width = " & PICNUM.Width
  12.    LabelHeight.Caption = "Height = " & PICNUM.Height
  13. End Sub
Feb 18 '11 #4

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

Similar topics

10
by: Chris Coho, Jr. | last post by:
Ok, I'll explain the whole problem because there may be several ways to solve this and hopefully someone knows one. What I'm doing is creating a specialty template editor, similar to say a corel...
0
by: Pachydermitis | last post by:
Hi all you experts, Does anyone know how to place a form that is in a referenced database as a subform in the current database. I have almost got it using SetParent api, but the form is locked...
1
by: Jerry S | last post by:
Hi I wonder if someone can help with this, because there's something I'm not understanding right. I've got a List Array of PictureBoxes. If I call PictureBoxListArray.Clear(), and then...
2
by: beanimanius | last post by:
working with about 100 picture boxes (not very big, 42X8) 1 image list of 5 pictures hopefully 1 context menu how do you program a contex menu so that it knows what picture box you are clicking...
2
by: Bwells | last post by:
Sorry for the legacy question (VB6) but the program I need to implement printing on has not been converted to .Net yet. I have a form with 4 Picture Boxes on it. These boxes are used as a...
1
by: eric_berlin | last post by:
I am writing a multithreaded application that has 6 threads each writing 5 frames per second video bitmaps to a different picture box. I have just found out that only the main UI thread is supposed...
0
by: T Clancey | last post by:
Hi. I'm trying to put together a very simple label designer to add to a project, this will allow users to enter text data. I can DrawSting the data into the picture boxes as required, but I...
2
by: lord.zoltar | last post by:
I have a couple of images I'm using to try and pretty up some forms. They are PNG images with transparent parts. I have one of them partly overlaying the other, but my problem is with the...
4
by: robertko2 | last post by:
Hello everyone, This is my first post here, and was hoping someone could lead me on the right track to quality resizing of drawing files like .bmp .jpg etc in VB6 Image or Picture boxes. I'm...
12
by: Chrono Dark | last post by:
I have 12 picture boxes and I am calling a method called ShowDice() to show the image of the dice. Here is what I am doing exactly: - Generate a random number for 12 integers - Use a for loop...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.