ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VB Form vs VBA UserForm problems... (https://www.excelbanter.com/excel-programming/327941-vbulletin-form-vs-vba-userform-problems.html)

R Avery[_2_]

VB Form vs VBA UserForm problems...
 
I come from a VBA environment where I am used to doing things like
abstracting away UI elements like moving items in a listbox up or down
with items... into some DLL that i make with a ListOrderer class which
you use by passing references to the listbox control and all of the
up/down buttons.

Now that I am writing some things in VB6, I found that I cannot simply
just export my VBA (designed in Excel) forms and import them into VB6
Forms. Why do these form objects appear in the "Designers" portion of
the TreeView rather than the "Forms" portion.

So, I started designing a VB6 form, and hoped that it could use the
same ListOrderer class that I used in the VBA form. Unfortunately, VB6
does not use MSForms controls, but rather uses VB controls. VB
controls have different methods, properties, etc! That is one problem
I don't understand, but I can get over it. It means i'd have to design
a new ListOrderer for VB6. So I did that. Unfortunately, it gave me
an error saying that "A property or method call cannot include a
reference to a private object, either as an argument or as a return
value" when I made the arguments to the ListOrderer class VB.Listbox
and VB.Button. So i simply changed them to Object and hoped it would
work.

However, it still doesn't work because when i try to use the
ListOrderer (which is compiled in a separate DLL) in the Standard EXE
Form i am trying to make, it gives me this error again. I looked
online for some descriptions of the error and I found the following
MSDN link:

http://msdn.microsoft.com/library/de...ary/en-us/vbco...

According to this, I can't pass VB controls to DLLs PERIOD! What is
that? How do you guys abstract UI functionality like drag and drop
items between two listboxes or automatically sync'ing a form's controls
(with set tag properties) to a custom object's properties?

Any help in response to any of my questions above would be greatly
appreciated. Thanks.



All times are GMT +1. The time now is 06:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com