به پنلش دو تا باتم با کارایی +/- کردن مقدار ادیت تکست گذاشتم
الان وقتی رو باتم کلیک میکنم ؟آخرین 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
سوال
parham01 82
سلام خسته نباشید
از ادیت تکست در اسکرول ویو استفاده کردم
به پنلش دو تا باتم با کارایی +/- کردن مقدار ادیت تکست گذاشتم
الان وقتی رو باتم کلیک میکنم ؟آخرین 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 پاسخ به این سوال تاکنون داده شده است
ارسالهای توصیه شده
بایگانی شده
این موضوع بایگانی و قفل شده و دیگر امکان ارسال پاسخ نیست.