This mail is long and wrotein bad english ... but i think that is interesting, appealing, attractive .... (my dictionary ahven't other words to catch your attention 8)).
I'm back with Weird problem that drive me crazy.
The code to reproduce the problem is below.
I have a form with a pageframe with an activex in the first page (in the example i used a treeview).
The pageframe have property tabs = .f., the pages are choiced by special toolbar buttons (simulated by two buttons with click code on "when" that in the last code row returns .F., to simulate toolbar buttons).
In the second page of pageframe there is a textbox to activate the Cut&Paste actions.
There is a way to "CUT" with CTRL-X or the Cut toolbar button (if avaible ) the ActiveX!
Follow this step on the example form:
1) Press "Page1" Button (you'll see the textbox selected and the cut toolbar button, if visible, activated)
2) Press "Page2" Button (Note that the cut operation remain avaible)
3) Press Ctrl-X, or press Cut Toolbar Button and Activex will dissapear!
SomeOne can explain me WHY Activex is cutted ?
Thanx in Advance!
------------------------------------------------
o = CREATEOBJECT("CutActiveX")
o.show(0)
READ events
return
DEFINE CLASS cutActiveX AS form
Top = 0
Left = 0
Height = 312
Width = 487
DoCreate = .T.
Caption = "Form1"
Name = "Form1"
ADD OBJECT pageframe1 AS pageframe WITH ;
ErasePage = .T., ;
PageCount = 2, ;
Top = 0, ;
Left = 0, ;
Width = 372, ;
Height = 300, ;
Tabs = .F., ;
Name = "Pageframe1", ;
Page1.Caption = "Page1", ;
Page1.Name = "Page1", ;
Page2.Caption = "Page2", ;
Page2.Name = "Page2"
ADD OBJECT command1 AS commandbutton WITH ;
Top = 12, ;
Left = 384, ;
Height = 27, ;
Width = 84, ;
Caption = "Page 1", ;
Name = "Command1"
ADD OBJECT command2 AS commandbutton WITH ;
Top = 48, ;
Left = 384, ;
Height = 27, ;
Width = 84, ;
Caption = "Page 2", ;
Name = "Command2"
PROCEDURE Init
THIS.pageframe1.Page1.AddObject('TV', "olecontrol", "MSComCtlLib.TreeCtrl")
this.pageframe1.Page1.TV.Nodes.Add(,2,'_Root', 'root')
this.pageframe1.Page1.TV.Visible = .T.
this.pageframe1.Page1.TV.Height = 204
this.pageframe1.Page1.TV.Width = 228
THIS.pageframe1.Page2.AddObject('Txt', "TextBox")
THIS.pageframe1.Page2.Txt.Visible = .T.
THIS.pageframe1.Page2.Txt.Value = 'String'
THIS.pageframe1.Page2.Txt.SelectOnEntry = .T.
ENDPROC
PROCEDURE destroy()
CLEAR events
endfunc
PROCEDURE command1.When
** The code to execute is in "when" event to simulate the toolbar button
** that don't catch focus
THISform.pageframe1.ActivePage= 1
RETURN .f.
ENDPROC
PROCEDURE command2.When
** The code to execute is in "when" event to simulate the toolbar button
** that don't catch focus
THISform.pageframe1.ActivePage= 2
RETURN .f.
ENDPROC
ENDDEFINE
------------------------------------------------------------------------
bye, Emanuele!
In the beginning the Universe was created.
This has made a lot of people very angry and been widely regarded as a bad move.