Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
VSFLEXGRID CONTROL
#1
I have inserted VSFLEXGRID CONTROL in a dialog. How do I refer to the control and update on the dialog box. Like the control is showing 9 columns by default I want to change to 3.
#2
I don't have the control to test, but common code for ActiveX controls is
Function Dialog41
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

str controls = "3"
str ax3SHD
if(!ShowDialog("Dialog41" &Dialog41 &controls)) ret

;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 223 135 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 ActiveX 0x54030000 0x0 26 16 96 48 "SHDocVw.WebBrowser"
;END DIALOG
;DIALOG EDITOR: "" 0x203000C "*" "" ""

ret
;messages
SHDocVw.WebBrowser we3
we3._getcontrol(id(3 hDlg))
sel message
,case WM_INITDIALOG
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1

here we3 is ActiveX control variable, and you can call its functions like
we3.Function(arguments)
#3
This control displays grid. When dialog box is intialised it display default control. Now when I am setting functions of the control no change is appearing in the control. Is there any sort of refresh or redraw is required? No error message is display that mean syntax is fine. I am trying just simple function for setting a (3 x 4) grid.
#4
No, when you call something like grid3.Rowcount=3, it should set row count immediately.
#5
found similar control
Function Dialog45
Code:
Copy      Help
\Dialog_Editor
typelib MSFlexGridLib {5E9E78A0-531B-11CF-91F6-C2863C385E30} 1.0
function# hDlg message wParam lParam
if(hDlg) goto messages

if(!ShowDialog("Dialog45" &Dialog45 0)) ret

;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 223 135 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 ActiveX 0x54030000 0x0 2 2 196 48 "MSFlexGridLib.MSFlexGrid {6262D3A0-531B-11CF-91F6-C2863C385E30} data:E585A5D0AA4293D1A27487688334A52541D9E9297C0AC17CC416169478846C108A9AD1DEB75F40C804"
;END DIALOG
;DIALOG EDITOR: "" 0x203000C "*" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,MSFlexGridLib.MSFlexGrid ms3
,ms3._getcontrol(id(3 hDlg))
,ms3.Cols=5
,ms3.Rows=3
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
#6
I have tried this but control does not update rows & cols in MSFLEXGRIDLIB also. Same is happening with VSFLEXGRID CONTROL.
#7
Don't know, this code works well on my computer.

Also tried to set rows/cols later, on button click, and works too.
Function Dialog45
Code:
Copy      Help
\Dialog_Editor
typelib MSFlexGridLib {5E9E78A0-531B-11CF-91F6-C2863C385E30} 1.0
function# hDlg message wParam lParam
if(hDlg) goto messages

if(!ShowDialog("Dialog45" &Dialog45 0)) ret

;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 223 135 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 ActiveX 0x54030000 0x0 2 2 196 48 "MSFlexGridLib.MSFlexGrid {6262D3A0-531B-11CF-91F6-C2863C385E30} data:E585A5D0AA4293D1A27487688334A52541D9E9297C0AC17CC416169478846C108A9AD1DEB75F40C804"
;4 Button 0x54032000 0x0 12 70 48 14 "Button"
;END DIALOG
;DIALOG EDITOR: "" 0x203000C "*" "" ""

ret
;messages
MSFlexGridLib.MSFlexGrid ms3
ms3._getcontrol(id(3 hDlg))
sel message
,case WM_INITDIALOG
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 4
,ms3.Cols=5
,ms3.Rows=3
,
,case IDOK
,case IDCANCEL
ret 1
#8
Now I am trying on my VSFLEXGRID control it gives following error

invalid interface pointer. Use _create or other function to create or get object
#9
The dialog function is called multiple times, and you have to call getcontrol every time you need to use the variable. Its best to insert the code before the first sel, like in my some example, then the variable will always be valid in following code.
#10
Thanks, now everything is working fine.


Forum Jump:


Users browsing this thread: 1 Guest(s)