Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to access control within OCX?

Status
Not open for further replies.

GEAK

Instructor
Feb 1, 2001
90
US
I'm trying to put together a program (VB.Net) that looks essentially like a standard Accpac form (PO entry) but mine will hide certain components in certain situations. I've done this with field edit controls in other apps but in this case I'm trying to hide a column in a grid that appears to be nested within a subform within the form... (don't know if that describes it right).

Using the U.I. Info tool (and a lot of trial and error) I was able to determine that the control I'm after is "vlsPOPORL".

My form has an AxAccpacPO1210UICtrl on it. In the form's class I've created an Accpac1210.AccpacControl (m_Grid) and in the OnUIAppOpened event I'm initializing it:

m_Grid = PurchaseOrderCtrl.UIAppControls("vlsPOPORL")

However, since it's a generic control object I only have limited access to it's properties at runtime: Caption, Container, Enabled, Height, Left, MacroEnabledFlag... and a handful of methods.

Does anyone know of a way to create an instance of the proper control class that'll allow me to hide a column? I've used WinSpy to view the PO form at runtime and found the class name for the grid is CAccpacViewList (it looks a lot like the class names based on MFC in C++).

If push comes to shove I'll move the control off the form and "plant" another one in it's place but this strikes me as a kludge that I'd rather avoid.

TIA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top