Hi everyone,
I have a tiny problem here but just cant handle it, since I'm new to VB6..
I want to put a code into a module which contains a lot of lines with same objects. I have an idea of relating those objects with variables, so instead of, for example, form1.picture1.backcolor = form1.picture2.backcolor the code line would look like A = B or something, but I just cant find a right way to do it. To make it clear, I need to relate form1.picture1.backcolor with variable A, form1.picture2.backcolor with B etc., and be able to use those in a module. So any ideas would really make it easier..
deftones
0
Light Poster
Recommended Answers
Jump to PostHi, To relate code and object, class module can be useful. Inside a class module have a reference of Form or Picture box.
'In class Module Dim A as Form1 'or Dim A as PictureBox so you can use 'If it is Form A.Picture1.BackColor = vbRed 'If …
Jump to PostIt is possible to refer whole path (Form1.Pic1.BackColor) only when that the whole path refers an Object.
But BackColor is Long data type also it is not a reference type. You cannot refer this. Why i am saying reference type is when you change anything in reference type it …
All 5 Replies
selvaganapathy
31
Posting Pro
deftones
0
Light Poster
selvaganapathy
31
Posting Pro
deftones
0
Light Poster
selvaganapathy
31
Posting Pro
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.