Hello,
i would like to create a menu in a userform.
That was easy to do (thanks to api) to create a menu and submenu in vba 32 bits.
I managed to do it in vba 64 bits for Zwcad.
But I have a problem with vba 64 bits for Autocad.
when i use TrackPopupMenuEx , the menu appears in gray not enable to click.
If you have an idea to solve the problem ... thank you.
Hello,
i would like to create a menu in a userform.
That was easy to do (thanks to api) to create a menu and submenu in vba 32 bits.
I managed to do it in vba 64 bits for Zwcad.
But I have a problem with vba 64 bits for Autocad.
when i use TrackPopupMenuEx , the menu appears in gray not enable to click.
If you have an idea to solve the problem ... thank you.
Since everyone is using 64-bit AutoCAD with 64-bit VBA nowadays, there is no extra support for UI components except for those built into 64-bit VBA's tool box.
You might be able to find some third party UI components, but they are scarce, and not many people want to waste time to develop/maintain these types of stuff. Or, if you are really capable of raw Widows APIs, you could dig into that. IMO, trying to build an rather sophisticated UI with 64-bit VBA is waste of time/effort in most cases.
It would rather easy to build UI as you showed with .NET technology with AutoCAD .NET API. If your business application requires good UI, I'd say: do not waste your time with 64-bit VBA.
Norman Yuan
Since everyone is using 64-bit AutoCAD with 64-bit VBA nowadays, there is no extra support for UI components except for those built into 64-bit VBA's tool box.
You might be able to find some third party UI components, but they are scarce, and not many people want to waste time to develop/maintain these types of stuff. Or, if you are really capable of raw Widows APIs, you could dig into that. IMO, trying to build an rather sophisticated UI with 64-bit VBA is waste of time/effort in most cases.
It would rather easy to build UI as you showed with .NET technology with AutoCAD .NET API. If your business application requires good UI, I'd say: do not waste your time with 64-bit VBA.
Norman Yuan
hello norman,
thanks for your answer but i'm not wasting time on vba.
i work on vba since 2003, so i'm not gonna waste time learning a new langage.
if you don't have the answer, it's not a problem.
I hope someone still using vba 64 on autocad with api and will be able to give me a solution 🙂
best regard.
hello norman,
thanks for your answer but i'm not wasting time on vba.
i work on vba since 2003, so i'm not gonna waste time learning a new langage.
if you don't have the answer, it's not a problem.
I hope someone still using vba 64 on autocad with api and will be able to give me a solution 🙂
best regard.
Norman is not saying that you are wasting your time with VBA. I still find uses for it. But you're wasting your time trying to find a menu system in VBA. You're probably stuck with using button's. However, you can hide and show buttons based on context.
Norman is not saying that you are wasting your time with VBA. I still find uses for it. But you're wasting your time trying to find a menu system in VBA. You're probably stuck with using button's. However, you can hide and show buttons based on context.
Thank you Ed Jobe for your answer.
Yes i found a similar solution on web , using caption and listbox with hide/show methode.
so i guess it's the solution...
I just explained that the code based on api that i'm trying to use in vba64 for autocad is ok in zwcad vba64.
So i think it's a bit strange. vba64 should be the same no?
I tried to chek security commands on autocad but it didn't change anything in my vba script. so sad.
Thank you Ed Jobe for your answer.
Yes i found a similar solution on web , using caption and listbox with hide/show methode.
so i guess it's the solution...
I just explained that the code based on api that i'm trying to use in vba64 for autocad is ok in zwcad vba64.
So i think it's a bit strange. vba64 should be the same no?
I tried to chek security commands on autocad but it didn't change anything in my vba script. so sad.
@contactALQK9 wrote:So i think it's a bit strange. vba64 should be the same no?
Are you asking about 32bit? No, they're not the same. One is compiled to 32 bit dll and the other is compiled to 64 bit dll. You can't compile a 32 bit control to 64 bit and expect it to work. Only certain elements of the control seem to be visible, but it won't function.
@contactALQK9 wrote:So i think it's a bit strange. vba64 should be the same no?
Are you asking about 32bit? No, they're not the same. One is compiled to 32 bit dll and the other is compiled to 64 bit dll. You can't compile a 32 bit control to 64 bit and expect it to work. Only certain elements of the control seem to be visible, but it won't function.
so i finaly solved my problem.
i had to add TPM_NONOTIFY
so vba instruction became:
Ret = TrackPopupMenuEx(hMenu0, TPM_NONOTIFY Or TPM_RETURNCMD, pt.X, pt.Y, AutoCAD.Application.hWnd, ByVal 0&)
thanks to all.
i you need a sample code to add menu on userform in vba64 , i'm ok to help you 🙂 . bye
so i finaly solved my problem.
i had to add TPM_NONOTIFY
so vba instruction became:
Ret = TrackPopupMenuEx(hMenu0, TPM_NONOTIFY Or TPM_RETURNCMD, pt.X, pt.Y, AutoCAD.Application.hWnd, ByVal 0&)
thanks to all.
i you need a sample code to add menu on userform in vba64 , i'm ok to help you 🙂 . bye
Can't find what you're looking for? Ask the community or share your knowledge.