Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / March 2005

Tip: Looking for answers? Try searching our database.

Task Pane

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve - 22 Mar 2005 00:09 GMT
I would like to hide a custom task pane that I have created, so i have added
the following code to the onload event

Dim oTaskPane As HTMLTaskPaneObject =  thisXDocument.View.Window.TaskPanes(0)
           oTaskPane.Visible = False

and get the following error

System.NullReferenceException
Object reference not set to an instance of an object.

any suggestions on how to hide the task pane, until i open it on a onchange
event.
Greg Collins [InfoPath MVP] - 22 Mar 2005 01:17 GMT
The problem you have is that during the OnLoad event, the View object doesn't exist. You will need to do this during the OnSwitchView event. If you only want it to happen once, you will need to set a flag in your code to identify whether you've already done this (i.e. assuming there is more than one view to switch to).

Signature

Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com

I would like to hide a custom task pane that I have created, so i have added
the following code to the onload event

Dim oTaskPane As HTMLTaskPaneObject =  thisXDocument.View.Window.TaskPanes(0)
           oTaskPane.Visible = False

and get the following error

System.NullReferenceException
Object reference not set to an instance of an object.

any suggestions on how to hide the task pane, until i open it on a onchange
event.
Steve - 22 Mar 2005 02:37 GMT
Thanks,  it works, but seems to me that it is a messy way of doing it.  

> The problem you have is that during the OnLoad event, the View object doesn't exist. You will need to do this during the OnSwitchView event. If you only want it to happen once, you will need to set a flag in your code to identify whether you've already done this (i.e. assuming there is more than one view to switch to).
>
[quoted text clipped - 11 lines]
> any suggestions on how to hide the task pane, until i open it on a onchange
> event.
Greg Collins [InfoPath MVP] - 22 Mar 2005 03:19 GMT
You are right -- but there's no other way. The part I don't like is that you see the task pane flash as it displays and then disappears. Oh well!

Signature

Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com

Thanks,  it works, but seems to me that it is a messy way of doing it.  

"Greg Collins [InfoPath MVP]" wrote:

> The problem you have is that during the OnLoad event, the View object doesn't exist. You will need to do this during the OnSwitchView event. If you only want it to happen once, you will need to set a flag in your code to identify whether you've already done this (i.e. assuming there is more than one view to switch to).
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.