Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2006-07-17
6
Medium Priority
?
162 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

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

Accepted Solution

by:
Bob Learned earned 1000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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…
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

876 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