Solved

Having problems getting "advanced" rendering to work when designing a VB.NET 2005 user control

Posted on 2006-07-17
6
158 Views
Last Modified: 2010-04-23
I need to create a user control similar to a combobox, where if you hit an arrow to the right of it, it will pop up a list of selections that is rendered on top of all other controls on the form.

This is all fine except for this issue: with the Microsoft combobox control, when you select that arrow, the list of selections doesn't get clipped off by other controls on the form.  With my user control, I have to say that the control gets bigger (i.e. me.Height += 150), and the selections can get "hidden" (trapped behind) other controls on the form.  

How do I get the rendering I'm looking for?  (note that me.bringtofront won't solve this issue in all cases)

Thanks in advance!
0
Comment
Question by:stev0931
  • 3
  • 3
6 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17140426
How are you doing all this?

Bob
0
 

Author Comment

by:stev0931
ID: 17143753
I'm doing it inside a user control in VB.NET 2005.  

What I have is probably not the way it should be, since I can't get this to work.  But here it goes anyway...  What I have is a textbox, button with a picture of an arrow on it, and a panel that contains labels - or other controls depending on the situation (this makes up the part that "drops down" for the user to make a selection).
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17151017
Have you thought about using a <div> element to overcome the z-order problem?

Bob
0
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 

Author Comment

by:stev0931
ID: 17154268
How would this work?
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 250 total points
ID: 17154477
It is tough to envision you environment, but we render a custom web control with a <div> element this way:

        ''' -----------------------------------------------------------------------------
        ''' <summary>
        ''' Write the div that will be used for the popup.
        ''' </summary>
        ''' <param name="output">stream to write to</param>
        ''' <remarks>
        ''' </remarks>
        ''' <history>
        '''       6/15/2005      Created
        ''' </history>
        ''' -----------------------------------------------------------------------------
        Protected Overrides Sub WritePopupDiv()
            Dim tw As New System.IO.StringWriter
            Dim output As New HtmlTextWriter(tw)

            Dim FilteredTableID As String = ClientID + "_table"
            output.AddAttribute("id", "FilteredTableDropList")
            output.AddAttribute("class", DropListInvisibleCssClass)
            output.AddStyleAttribute("clear", "both")
            output.AddStyleAttribute("z-index", "30000")
            output.RenderBeginTag("div")

            If UseFontOnDropDown Then
                RenderFontAttributes(output)
            End If

            If (CssClass <> "") Then
                output.AddAttribute("class", DroplistTableCssClass)
            Else
                output.AddAttribute("cellpadding", "0px")
                output.AddAttribute("cellspacing", "2px")
            End If

            RenderDropTable(output)

            output.RenderEndTag()

            Page.RegisterClientScriptBlock("FilteredTableDroplistMarkup", tw.GetStringBuilder().ToString())
        End Sub

Bob
0
 

Author Comment

by:stev0931
ID: 17197263
Thanks!
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to retrieve a mysql date column that has 0000-00-00 in vb.net 8 43
get row value in vb.net 4 18
Footer for each row on Gridview 2 33
VB.NET 2008 - SQL Timeout 9 34
Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

830 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