Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 To: sandeep singh
  Where is sandeep singh?
 ludhiana
 India
 sandeep singh
 Tags
Subject: RE: Combo
Thread ID: 365571 Message ID: 365578 # Views: 62 # Ratings: 1
Version: Visual FoxPro 9 Category: VFP and .NET
Date: Friday, December 28, 2012 8:29:15 AM         
   


> Hi Experts
> Can i used Combo list With Enabled Record Combo
> Like
> my Database Field Ser,Title,Lock
>
> SELECT Staxcode
> SELECT DISTINCT Title,Ser FROM Staxcode INTO ARRAY _Stax ORDER BY Ser
> THISFORM.Combo3.ROWSOURCE='_STax'
> THISFORM.Combo3.ROWSOURCETYPE=5
> THISFORM.Combo3.REQUERY
> THISFORM.Combo3.DISPLAYVALUE=1
>
> i Want to use if Lock Field .T. Then Combo list Record Enabled With .T.
> and Other Disable
>


You can disable row-source items for certain row-source types of combo boxes by adding a leading backslash. e.g. "\Title" would be disabled when Combo.RowSourceType=5 whereas "Title" would not, see also the runnable sample pasted below



hth
-Stefan



LOCAL oForm as Form
oForm = CREATEOBJECT("TestForm")
oForm.Show(1)
RETURN

DEFINE CLASS TestForm as Form
	AutoCenter = .T.
	DataSession = 2
	DIMENSION aRowSource[1]
	
	PROCEDURE Load
		CREATE CURSOR test (Ser I, Title C(10), Locked L)
		INSERT INTO test VALUES (1, "One", .T.)
		INSERT INTO test VALUES (2, "Two", .F.)
		INSERT INTO test VALUES (3, "Three", .T.)
	ENDPROC
	
	ADD OBJECT Combo1 as ComboBox WITH Left = 50, Top = 50
	PROCEDURE Combo1.Init
		SELECT ;
			CAST( IIF(locked, "", "\") + title As Char(11) ) ;
			FROM test INTO ARRAY Thisform.aRowSource
		This.RowSource = "Thisform.aRowSource"
		This.RowSourceType = 5
	ENDPROC
ENDDEFINE


ENTIRE THREAD

Combo Posted by sandeep singh @ 12/28/2012 6:46:04 AM
RE: Combo Posted by Stefan Wuebbe @ 12/28/2012 8:29:15 AM
RE: Combo Posted by sandeep singh @ 12/28/2012 11:27:57 AM
RE: Combo Posted by Stefan Wuebbe @ 12/28/2012 12:52:04 PM