Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > FlowLayout/GridLayout from design mode: I've done it!!! :D

Reply
Thread Tools

FlowLayout/GridLayout from design mode: I've done it!!! :D

 
 
Rob Mayo
Guest
Posts: n/a
 
      07-21-2003
OK, dig this.

You have a custom server control you're building. You have a custom designer for that control. If you add a COM reference to MSHTML, you can determine whether the page your control sits on is in GridLayout or FlowLayout with this code in your designer:

Private Function IsPageInGridMode() As Boolean
Dim text1 As String
Dim blnResult As Boolean = False
Try
Dim element1 As mshtml.IHTMLElement
Dim element2 As mshtml.IHTMLElement

element1 = CType(MyBase.DesignTimeElement, mshtml.IHTMLElement)
element2 = CType(element1.offsetParent, mshtml.IHTMLElement)

'For now, offsetParent will get you the parent element,
'not necessarily the BODY tag. Will add recursive routine
'to get <BODY> later

text1 = element2.getAttribute("MS_POSITIONING")

If LCase(text1) = "gridlayout" Then blnResult = True
Catch e As Exception
Return false
End Try
Return blnResult
End Function

It's dirty, but it works
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bind a SQL table to a dropdownlist at design time? Surely it can be done? GG ASP .Net 3 05-14-2009 12:36 PM
I asked before and was told it could not be done, well its Done...?? Karen Parker NZ Computing 32 08-27-2004 07:21 AM
I asked before and was told it could not be done, well its Done...?? Karen Parker NZ Computing 7 08-26-2004 02:25 AM
How to let browsers be done when parent is done and not wait for childrn's finishing in CGI Zhidian Du Perl Misc 0 02-21-2004 07:01 PM
FlowLayout/GridLayout from design mode: I've done it!!! :D Rob Mayo ASP .Net Web Controls 0 07-21-2003 06:12 PM



Advertisments