Setting a control's stacking order

C

CES

All,
I'm trying to figure out how to bring to front a control using code:

Basically I have 5 Rows of boxes that make up an address.

Country = Combo Box
Address line 1 = Text Box
Address line 2 = Text Box
Address line 3 = 1 Text Box Or 3 Text Boxes depending on the country that is chosen
Address line 4 = 1 Text Box Or 3 Text Boxes depending on the country that is chosen


If the country is not US that I want to hide the visibility of the three text boxes that make up street number, street address, apartment number and show only the Address3 text box that currently resides below the three visible text boxes. I then want to do the same with city states zip.

The code that I've attempted is below:


If tmp.bxCboCountry > 1 And tmp.bxCboCountry <> "" Then
tmp.bxTxtStreetNum.Visible = False
tmp.bxTxtStreetName.Visible = False
tmp.bxTxtAptNum.Visible = False
tmp.bxTxtCity.Visible = False
tmp.bxTxtState.Visible = False
tmp.bxTxtZip.Visible = False

'
tmp.bxTxtAddress3.Visible = True
tmp.bxTxtAddress4.Visible = True
Else
tmp.bxTxtStreetNum.Visible = True
tmp.bxTxtStreetName.Visible = True
tmp.bxTxtAptNum.Visible = True
tmp.bxTxtCity.Visible = True
tmp.bxTxtState.Visible = True
tmp.bxTxtZip.Visible = True

'
tmp.bxTxtAddress3.Visible = False
tmp.bxTxtAddress4.Visible = False
End If

The problem with this is while it does accurately adjust the visibility of the boxes it does not change the stacking order and I can't seem to find how to do that basically sending city state zip to the back and bring forward address4.

I would appreciate any advice on accomplishing this task. Thanks in advance. - CES
 
C

CES

CES said:
All,
I'm trying to figure out how to bring to front a control using code:

Basically I have 5 Rows of boxes that make up an address.

Country = Combo Box
Address line 1 = Text Box
Address line 2 = Text Box
Address line 3 = 1 Text Box Or 3 Text Boxes depending on the country
that is chosen
Address line 4 = 1 Text Box Or 3 Text Boxes depending on the country
that is chosen


If the country is not US that I want to hide the visibility of the three
text boxes that make up street number, street address, apartment number
and show only the Address3 text box that currently resides below the
three visible text boxes. I then want to do the same with city states zip.

The code that I've attempted is below:


If tmp.bxCboCountry > 1 And tmp.bxCboCountry <> "" Then
tmp.bxTxtStreetNum.Visible = False
tmp.bxTxtStreetName.Visible = False
tmp.bxTxtAptNum.Visible = False
tmp.bxTxtCity.Visible = False
tmp.bxTxtState.Visible = False
tmp.bxTxtZip.Visible = False

'
tmp.bxTxtAddress3.Visible = True
tmp.bxTxtAddress4.Visible = True
Else
tmp.bxTxtStreetNum.Visible = True
tmp.bxTxtStreetName.Visible = True
tmp.bxTxtAptNum.Visible = True
tmp.bxTxtCity.Visible = True
tmp.bxTxtState.Visible = True
tmp.bxTxtZip.Visible = True

'
tmp.bxTxtAddress3.Visible = False
tmp.bxTxtAddress4.Visible = False
End If

The problem with this is while it does accurately adjust the visibility
of the boxes it does not change the stacking order and I can't seem to
find how to do that basically sending city state zip to the back and
bring forward address4.

I would appreciate any advice on accomplishing this task. Thanks in
advance. - CES
I'm stupider then most I had another function that was always setting the visibility of bxTxtAddress4, bxTxtAddress3.Visible = False. -CES
 
P

Peter Yang [MSFT]

Hello,

You may want also want to set the hidden controls properties to test the
situation:

1) Set all of the other fields to FieldName.Enabled = False
2) Set all of the other fields to FieldName.TabStop = False

If the issue persists, will you compress a sample database, and send it to
me for reproducing? Please remove online from my displayed email address.
Thank you.


Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications
<http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx>.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
<http://msdn.microsoft.com/subscriptions/support/default.aspx>.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
P

Peter Yang [MSFT]

Hello,

I'm still interested in this issue. If you have any comments or questions,
please feel free to let's know. We look forward to hearing from you.

Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

=====================================================


This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top