Solved

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

Posted on 2006-07-17
6
155 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

760 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

18 Experts available now in Live!

Get 1:1 Help Now