Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
One more minute and I will beat my head on the table
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01124687
Message ID:
01124729
Vues:
10
Trying to change height and width and top and left doesn't work. The mover remains the same size initially.
loform = Createobject('Form')
loForm.addobject('myMover', 'cntmover')
with loForm.myMover
	.top = 20
	.left = 20
	.height = 400
	.width = 100
	.Visible = .t.
endwith	
loForm.Show(1)
>Naomi,
>
>I bet the problem is in your base classes, I run this (changing base classes) and it works
>
>
>
>loform = Createobject('Form')
>loForm.addobject('myMover', 'cntmover')
>loForm.myMover.Visible = .t.
>loForm.Show(1)
>
>DEFINE CLASS cntmover AS container
>
>
>	Anchor = 15
>	Width = 379
>	Height = 210
>	BorderWidth = 1
>	TabIndex = 1
>	Name = "cntmover"
>
>
>	ADD OBJECT lstinput AS listbox WITH ;
>		Anchor = 135, ;
>		ColumnCount = 2, ;
>		ColumnWidths = "250,0", ;
>		RowSourceType = 0, ;
>		Height = 180, ;
>		ColumnLines = .F., ;
>		Left = 4, ;
>		TabIndex = 10, ;
>		Top = 24, ;
>		Width = 160, ;
>		ZOrderSet = 11, ;
>		Name = "lstInput"
>
>
>	ADD OBJECT lstoutput AS listbox WITH ;
>		Anchor = 45, ;
>		ColumnCount = 2, ;
>		ColumnWidths = "250,0", ;
>		RowSourceType = 0, ;
>		Height = 180, ;
>		ColumnLines = .F., ;
>		Left = 211, ;
>		TabIndex = 10, ;
>		Top = 24, ;
>		Width = 160, ;
>		ZOrderSet = 11, ;
>		Name = "lstOutput"
>
>
>	ADD OBJECT cmdfeedtoright AS commandbutton WITH ;
>		Top = 70, ;
>		Left = 169, ;
>		Height = 22, ;
>		Width = 39, ;
>		Anchor = 768, ;
>		Caption = ">", ;
>		Name = "cmdFeedToRight"
>
>
>	ADD OBJECT cmdfeedalltoright AS commandbutton WITH ;
>		Top = 92, ;
>		Left = 169, ;
>		Height = 22, ;
>		Width = 39, ;
>		Anchor = 768, ;
>		Caption = ">>", ;
>		Name = "cmdFeedAllToRight"
>
>
>	ADD OBJECT cmdfeedtoleft AS commandbutton WITH ;
>		Top = 118, ;
>		Left = 169, ;
>		Height = 22, ;
>		Width = 39, ;
>		Anchor = 768, ;
>		Caption = "<", ;
>		Name = "cmdFeedToLeft"
>
>
>	ADD OBJECT cmdfeedalltoleft AS commandbutton WITH ;
>		Top = 140, ;
>		Left = 169, ;
>		Height = 22, ;
>		Width = 39, ;
>		Anchor = 768, ;
>		Caption = "<<", ;
>		Name = "cmdFeedAllToLeft"
>
>
>	ADD OBJECT lbloptions AS label WITH ;
>		FontBold = .T., ;
>		Caption = "Caption", ;
>		Left = 4, ;
>		Top = 4, ;
>		Width = 44, ;
>		Name = "lblOptions"
>
>
>	*-- Refreshes the listbox
>	PROCEDURE listrefresh
>		*---------------------- Location Section ------------------------
>		*   Library: 	Areportcontrols.vcx
>		*   Class: 		Cntmover
>		*   Method: 	Listrefresh()
>		*----------------------- Usage Section --------------------------
>		*)  Description:
>		*)
>
>		*   Scope:      Public
>		*   Parameters:
>		*$  Usage:
>		*$
>		*   Returns:
>		*--------------------- Maintenance Section ----------------------
>		*   Change Log:
>		*       CREATED 	05/24/2006 - NN
>		*		MODIFIED
>		*----------------------------------------------------------------
>		lparameters toThis
>		local lnIndex, lnTotItem
>
>		lnTotItem = toThis.listcount
>		if !empty(m.lnTotItem)
>			local array aListItem(m.lnTotItem)
>			for lnIndex =  1 to m.lnTotItem
>				aListItem(m.lnIndex) = toThis.list(m.lnIndex,1)
>			next
>			toThis.clear()
>			for lnIndex =  1 to m.lnTotItem
>				if !empty(aListItem(m.lnIndex))
>					toThis.additem(aListItem(m.lnIndex))
>				endif
>			next
>		endif
>	ENDPROC
>
>
>	PROCEDURE Refresh
>		local loControl
>		with this
>			store .t. to ;
>				.cmdFeedAllToRight.enabled, ;
>				.cmdFeedToRight.enabled, ;
>				.cmdFeedAllToLeft.enabled, ;
>				.cmdFeedToLeft.enabled
>			if .lstOutput.listcount = 0
>				store .f. to ;
>				.cmdFeedAllToLeft.enabled, ;
>					.cmdFeedToLeft.enabled
>			endif
>			if .lstInput.listcount = 0
>				store .f. to ;
>					.cmdFeedAllToRight.enabled, ;
>					.cmdFeedToRight.enabled
>			endif
>			* Fighting Anchor property - no result
>			for each loControl in .Controls
>				loControl.Anchor = m.loControl.Anchor
>			next
>		endwith
>	ENDPROC
>
>
>	PROCEDURE lstinput.DblClick
>		This.parent.cmdFeedToRight.Click()
>	ENDPROC
>
>
>	PROCEDURE lstoutput.DblClick
>		this.Parent.cmdFeedToLeft.Click()
>	ENDPROC
>
>
>	PROCEDURE cmdfeedtoright.Click
>		*---------------------- Location Section ------------------------
>		*   Library: 	Areportcontrols.vcx
>		*   Class: 		Cntmover
>		*   Method: 	Cmdfeedtoright.Click()
>		*----------------------- Usage Section --------------------------
>		*)  Description:
>		*)
>
>		*   Scope:      Public
>		*   Parameters:
>		*$  Usage:
>		*$
>		*   Returns:
>		*--------------------- Maintenance Section ----------------------
>		*   Change Log:
>		*       CREATED 	05/24/2006 - NN
>		*		MODIFIED
>		*----------------------------------------------------------------
>		local lcSelect, lnIndex
>		lnIndex = this.parent.lstInput.listindex
>		if m.lnIndex # 0
>			lcSelect = this.parent.lstInput.list(m.lnIndex,1)
>			this.parent.lstOutput.additem(m.lcSelect)
>			this.parent.lstInput.removelistitem(m.lnIndex)
>		endif
>		this.Parent.ListRefresh(this.Parent.lstInput)
>		this.parent.refresh()
>	ENDPROC
>
>
>	PROCEDURE cmdfeedalltoright.Click
>		*---------------------- Location Section ------------------------
>		*   Library: 	Areportcontrols.vcx
>		*   Class: 		Cntmover
>		*   Method: 	Cmdfeedalltoright.Click()
>		*----------------------- Usage Section --------------------------
>		*)  Description:
>		*)
>
>		*   Scope:      Public
>		*   Parameters:
>		*$  Usage:
>		*$
>		*   Returns:
>		*--------------------- Maintenance Section ----------------------
>		*   Change Log:
>		*       CREATED 	05/24/2006 - NN
>		*		MODIFIED
>		*----------------------------------------------------------------
>		local lcSelect, lnIndex, lnTotItem
>		lnTotItem = this.parent.lstInput.listcount
>		for lnIndex =  1 to m.lnTotItem
>			lcSelect = this.parent.lstInput.list(m.lnIndex,1)
>			this.parent.lstOutput.additem(m.lcSelect)
>		next
>		for lnIndex =  1 to m.lnTotItem
>			this.parent.lstInput.removelistitem(m.lnIndex)
>		next
>
>		this.parent.refresh()
>	ENDPROC
>
>
>	PROCEDURE cmdfeedtoleft.Click
>		*---------------------- Location Section ------------------------
>		*   Library: 	Areportcontrols.vcx
>		*   Class: 		Cntmover
>		*   Method: 	Cmdfeedtoleft.Click()
>		*----------------------- Usage Section --------------------------
>		*)  Description:
>		*)
>
>		*   Scope:      Public
>		*   Parameters:
>		*$  Usage:
>		*$
>		*   Returns:
>		*--------------------- Maintenance Section ----------------------
>		*   Change Log:
>		*       CREATED 	05/24/2006 - NN
>		*		MODIFIED
>		*----------------------------------------------------------------
>		LOCAL lcSelect, lnIndex
>		lnIndex = this.parent.lstOutput.ListIndex
>		IF m.lnIndex # 0
>			lcSelect = this.parent.lstOutput.LIST(m.lnIndex,1)
>			this.parent.lstInput.AddItem(m.lcSelect)
>			this.parent.lstOutput.RemoveListItem(m.lnIndex)
>		ENDIF
>		this.Parent.ListRefresh(this.Parent.lstOutput)
>		this.parent.refresh()
>	ENDPROC
>
>
>	PROCEDURE cmdfeedalltoleft.Click
>		*---------------------- Location Section ------------------------
>		*   Library: 	Areportcontrols.vcx
>		*   Class: 		Cntmover
>		*   Method: 	Cmdfeedalltoleft.Click()
>		*----------------------- Usage Section --------------------------
>		*)  Description:
>		*)
>
>		*   Scope:      Public
>		*   Parameters:
>		*$  Usage:
>		*$
>		*   Returns:
>		*--------------------- Maintenance Section ----------------------
>		*   Change Log:
>		*       CREATED 	05/24/2006 - NN
>		*		MODIFIED
>		*----------------------------------------------------------------
>		local lcSelect, lnIndex, lnTotItem
>		lnTotItem = this.parent.lstOutput.listcount
>		for lnIndex =  1 to m.lnTotItem
>			lcSelect = this.parent.lstOutput.list(m.lnIndex,1)
>			this.parent.lstInput.additem(m.lcSelect)
>		next
>		for lnIndex =  1 to m.lnTotItem
>			this.parent.lstOutput.removelistitem(m.lnIndex)
>		next
>		this.parent.refresh()
>	ENDPROC
>
>
>ENDDEFINE
>*
>*-- EndDefine: cntmover
>**************************************************
>
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform