رفتن به مطلب
  • 0

استفاده از ادیت تکست در اسکرول ویو


parham01

سوال

سلام خسته نباشید

از ادیت تکست در اسکرول ویو استفاده کردم

به پنلش دو تا باتم با کارایی +/- کردن مقدار ادیت تکست گذاشتم

الان وقتی رو باتم کلیک میکنم ؟آخرین id رو مقدار میده

میخوام وقتی رو هر کدوم کلیک می کنم مقدار همون اضافه و کم بشه

#Region  Project Attributes 
	#ApplicationLabel: B4A Example
	#VersionCode: 1
	#VersionName: 
	'SupportedOrientations possible values: unspecified, landscape or portrait.
	#SupportedOrientations: unspecified
	#CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes 
	#FullScreen: False
	#IncludeTitle: True
#End Region

Sub Process_Globals
	'These global variables will be declared once when the application starts.
	'These variables can be accessed from all modules.

End Sub

Sub Globals
	'These global variables will be redeclared each time the activity is created.
	'These variables can only be accessed from this module.
	Dim megh As Int
	Dim Stopint As Int=5%y
    Private sql1   As SQL
	Private Cur1   As Cursor		
	Private Label1 As Label
	Private Label2 As Label
	Private Panel1 As Panel
	Private ScrollView1 As ScrollView
	
	Private img1 As ImageView
	Private img2 As ImageView
	Private Button1 As Button
	Private Button2 As Button
	Private EditText1 As EditText

End Sub

Sub Activity_Create(FirstTime As Boolean)
	'Do not forget to load the layout file created with the visual designer. For example:
ScrollView1.Initialize(2000dip)
Activity.Title="Basic4android.org"
Activity.AddView(ScrollView1,0,0,100%x,100%y)
	'If File.Exists(File.DirInternal,"1.db")=False Then
	File.Copy(File.DirAssets,"1.db",File.DirInternal,"1.db")
	'End If
sql1.Initialize(File.DirInternal,"1.db",False)
Cur1=sql1.ExecQuery("SELECT * From data")
For i=0 To Cur1.RowCount-1
Cur1.Position=i
Dim p As Panel
p.Initialize("p")
ScrollView1.Panel.AddView(p,0,Stopint,100%x,100%Y)
Stopint=Stopint+150dip
p.LoadLayout("pnl")
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Panel1.Tag=i                            ''''  (range panel ha yek dar miun ghermez va abi mishe)'
If (i Mod 2)=1 Then						''''  (range panel ha yek dar miun ghermez va abi mishe)'
			Panel1.Color=Colors.Red		''''  (range panel ha yek dar miun ghermez va abi mishe)'
		Else							''''  (range panel ha yek dar miun ghermez va abi mishe)'
			Panel1.Color=Colors.Blue	''''  (range panel ha yek dar miun ghermez va abi mishe)'
		End If							''''  (range panel ha yek dar miun ghermez va abi mishe)'
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
img1.Tag=i
img2.Tag=i
Label1.Text="Name: "&Cur1.GetString("id")&"  "&Cur1.GetString("name")
Label2.Text="Text: "&Cur1.GetString("txt")
ScrollView1.Panel.Height=Stopint
Next
EditText1.Text = "amir"
End Sub


Sub img2_Click
Dim Send As ImageView
	Send=Sender               
	Msgbox2("Set Fav"&Send.Tag,"","","","",Null)
End Sub
Sub img1_Click
	Dim Send As ImageView
	Send=Sender
	Msgbox2("Share"&Send.Tag,"","","","",Null)
End Sub

Sub Button1_Click

	If EditText1.Text = "" Then
	Button1.Enabled = False
	Else
	EditText1.text = "deser"
	End If
End Sub
Sub Button2_Click
	EditText1.Text=megh
End Sub

 

لینک ارسال
به اشتراک گذاری در سایت های دیگر

3 پاسخ به این سوال تاکنون داده شده است

ارسال‌های توصیه شده

بفرما برات ساختم ( با این رو هر ادیت تکسی باشی ، عدد اون رو کم و زیاد می کنه ) + سورس

add-rec-num-of-edit-text

Sub Globals		
	Private EditText1 As EditText
	Private EditText2 As EditText
	Private EditText3 As EditText
	
	Dim s As Int = 0
	Dim num As Int
End Sub


Sub Button2_Click
	Select s 
		Case 1
			num = EditText1.Text
			num = num - 1
			EditText1.Text = num
		Case 2
			num = EditText2.Text
			num = num - 1
			EditText2.Text = num	
		Case 3
			num = EditText3.Text
			num = num - 1
			EditText3.Text = num
	End Select
End Sub

Sub Button1_Click
	Select s 
		Case 1
			num = EditText1.Text
			num = num + 1
			EditText1.Text = num
		Case 2
			num = EditText2.Text
			num = num + 1
			EditText2.Text = num	
		Case 3
			num = EditText3.Text
			num = num + 1
			EditText3.Text = num
	End Select
End Sub



Sub EditText1_FocusChanged (HasFocus As Boolean)
	s = 1
End Sub

Sub EditText2_FocusChanged (HasFocus As Boolean)
	s = 2
End Sub

Sub EditText3_FocusChanged (HasFocus As Boolean)
	s = 3
End Sub

Sub EditText1_TextChanged (Old As String, New As String)
	If EditText1.Text = "" Then
		EditText1.Text = "0"
	End If
End Sub

Sub EditText2_TextChanged (Old As String, New As String)
	If EditText2.Text = "" Then
		EditText2.Text = "0"
	End If
End Sub

Sub EditText3_TextChanged (Old As String, New As String)
	If EditText3.Text = "" Then
		EditText3.Text = "0"
	End If
End Sub

 

 

لینک ارسال
به اشتراک گذاری در سایت های دیگر

در ۱ ساعت قبل، softir گفته است :

بفرما برات ساختم ( با این رو هر ادیت تکسی باشی ، عدد اون رو کم و زیاد می کنه ) + سورس

add-rec-num-of-edit-text


Sub Globals		
	Private EditText1 As EditText
	Private EditText2 As EditText
	Private EditText3 As EditText
	
	Dim s As Int = 0
	Dim num As Int
End Sub


Sub Button2_Click
	Select s 
		Case 1
			num = EditText1.Text
			num = num - 1
			EditText1.Text = num
		Case 2
			num = EditText2.Text
			num = num - 1
			EditText2.Text = num	
		Case 3
			num = EditText3.Text
			num = num - 1
			EditText3.Text = num
	End Select
End Sub

Sub Button1_Click
	Select s 
		Case 1
			num = EditText1.Text
			num = num + 1
			EditText1.Text = num
		Case 2
			num = EditText2.Text
			num = num + 1
			EditText2.Text = num	
		Case 3
			num = EditText3.Text
			num = num + 1
			EditText3.Text = num
	End Select
End Sub



Sub EditText1_FocusChanged (HasFocus As Boolean)
	s = 1
End Sub

Sub EditText2_FocusChanged (HasFocus As Boolean)
	s = 2
End Sub

Sub EditText3_FocusChanged (HasFocus As Boolean)
	s = 3
End Sub

Sub EditText1_TextChanged (Old As String, New As String)
	If EditText1.Text = "" Then
		EditText1.Text = "0"
	End If
End Sub

Sub EditText2_TextChanged (Old As String, New As String)
	If EditText2.Text = "" Then
		EditText2.Text = "0"
	End If
End Sub

Sub EditText3_TextChanged (Old As String, New As String)
	If EditText3.Text = "" Then
		EditText3.Text = "0"
	End If
End Sub

ممنونم از وقتی که گداشتی

عالی بود

ولی  سورس من میاد اسکرول میکنه لیبل هارو

و اطلاعات هر فیلد نمایش میده من به هر پنل یه ادیت تکس دادم

 

 

 

لینک ارسال
به اشتراک گذاری در سایت های دیگر

بایگانی شده

این موضوع بایگانی و قفل شده و دیگر امکان ارسال پاسخ نیست.

  • کاربران آنلاین در این صفحه   0 کاربر

    • هیچ کاربر عضوی،در حال مشاهده این صفحه نیست.
×
×
  • اضافه کردن...