Solved

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

Posted on 2006-07-17
6
156 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

864 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

21 Experts available now in Live!

Get 1:1 Help Now