Solved

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

Posted on 2006-07-17
6
159 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: 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 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

738 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