Solved

Created option array(s) not visible

Posted on 2004-04-21
7
150 Views
Last Modified: 2010-08-05
I have created a form with 3 option buttons in 1 frame - frame1(0)  opt_ads(0) opt_percent(0)

though a loop I use the load statement to add 5 more combinations of the above ( in other words - an array of frame1(0) - frame1(5) and arrays of opt_ads(0) - opt_ads(5) and opt_percent(0) - opt_percent(5)
Each option button when created is assigned a container - to the corresponding frame - they do fit inside the frame

with frm_TimedDisplays
 for i = 1 to 5        
    Load .Frame1(i)
            With .Frame1(i)
                .Top = yPos - 10
                .Visible = True
                .ZOrder 0
            End With

   Load .opt_Ads(i)
            With .opt_Ads(i)
                .Top = yPos
                Set frm_TimedDisplays.opt_Ads(i).Container = frm_TimedDisplays.Frame1(i)
                .Visible = True
            End With

   Load .opt_Percentage(i)
            With .opt_Percentage(i)
                .Top = yPos
                Set frm_TimedDisplays.opt_Percentage(i).Container = frm_TimedDisplays.Frame1(i)
                .Visible = True
            End With
       
 next i
end with

 I have varified that the container statement does in fact work ( I can see the property - set focus to the button- and othe verifications)  properly and the option buttons are in fact put in as part of that frame -

THE PROBLEM (finally:)

I can't get the option buttons to appear - I have tried Zorder on the buttons , frames, containers - Set AutoRedraw - made frames invisible - then visible - same with buttons - Its like when you design a frame and put buttons on it sometimes you have to "sendtoback" the frame - this works fine in design but I cannot get anything to work programmically

please advise - thanks
bc

0
Comment
Question by:bczingo
  • 3
  • 3
7 Comments
 
LVL 3

Author Comment

by:bczingo
ID: 10883379
oops - should read 2 option buttons
0
 
LVL 19

Expert Comment

by:Shauli
ID: 10884031
Dim yPos As Long

yPos = Frame1(0).Top + Frame1(0).Height

With frm_TimedDisplays
    For i = 1 To 5
        Load .Frame1(i)
            With .Frame1(i)
                .Top = yPos
                .Visible = True
            End With

        Load .opt_ads(i)
            With .opt_ads(i)
                Set frm_TimedDisplays.opt_ads(i).Container = frm_TimedDisplays.Frame1(i)
                .Top = opt_ads(0).Top
                .Visible = True
            End With

        Load .opt_percent(i)
            With .opt_percent(i)
                Set frm_TimedDisplays.opt_percent(i).Container = frm_TimedDisplays.Frame1(i)
                .Top = opt_percent(0).Top
                .Visible = True
            End With
    yPos = Frame1(i).Top + Frame1(i).Height
    Next i
End With

S
0
 
LVL 3

Author Comment

by:bczingo
ID: 10889152
thanks S - but it doesn't help - I've made sure that the opt buttons are inside the frame several different ways-
Its like I said - make a frame - put opt buttons in it - send opt buttons to back and you can't see them but they are there
I need to bring them to the front

besides - It seem your code starts the top of the opt button at the bottom of the frame anyway
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 19

Expert Comment

by:Shauli
ID: 10889245
Have you ran this code? I don't think so. Start a project put the Frame1(0) on it and the two Option buttons(0) on it. Put a command button and put my code in the command button click event. It works. Itested it.

Good luck,

S
0
 
LVL 19

Accepted Solution

by:
Shauli earned 500 total points
ID: 10889663
ps. The reason why your code doesn't work is NOT because the option buttons are sent to back, it is because their TOP property is not set right. Same thing with the frame. That is all. The top property of the option buttons should be the same as the first buttons (in frame(0)). as they are located in a duplicated frame, and the top begins from 0 in each new frame. Then with your frame - you locate the new frames ON TOP of the original frame and subtract 10?????? if you want the frames one below the other then you need to calculate the top of the first frame and its height as I did in my code : yPos = Frame1(0).Top + Frame1(0).Height

Now, with that in mind, copy my code to your project and test it. It will work.

Hope this clears this issue,

S
0
 
LVL 3

Author Comment

by:bczingo
ID: 10893811
sorry left out-
before the loop
yInc= frame1(0).height + (frame1(0).height*.25)

and at end inside of loop

yPos = yPos + yInc

The frames do space down the form


I ended up kludging solution with checkboxes
havent tried your code yet - but i will
thanks
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now