Solved

Created option array(s) not visible

Posted on 2004-04-21
7
152 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Write data from SQL to CSV file - position 1 61
Determine Range to Select 5 48
How to incorporate an error traping routing to existing code in VB6 11 40
Help me. 3 54
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

772 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