وفتی کلیک میشن یک واحد به meghdar تو اکتیویتی اضافه یا کم بشه
(آخر سورس یه چیزایی نوشتم ولی کار نکرد)
سورس :
#Region Activity Attributes
#FullScreen: true
#IncludeTitle: false
#End Region
Sub Process_Globals
Dim num As Int
Dim sql2 As SQL
Dim meghdar As Int
End Sub
Sub Globals
Dim st As StringUtils
Private ScrollView1 As ScrollView
Private lbl As Label
Dim fara As Farakhani
Dim cur As Cursor
Private share As Button
Private fontsize As Spinner
Private copy As Button
Dim s As AriaLib
Private Label1 As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("reading")
ScrollView1.Panel.LoadLayout("text")
Activity.Color = Colors.RGB(221,81,130)
lbl.Gravity = Gravity.CENTER
lbl.TextColor = Colors.White
lbl.TextSize = 25
lbl.Typeface = Typeface.LoadFromAssets("W_yekan Bold_p30download.com_0.ttf")
lbl.Height = -2
fara.FarakhaniMatn("khoon.db",sql2,cur,"SELECT * FROM tbl Where ID=",meghdar,lbl,"matn")
' fara.FarakhaniMatn("khoon.db",sql2,cur,"SELECT * FROM tbl Where ID=",meghdar,Label1,"name")
If File.Exists(File.DirInternal,"fs.txt") = False Then
File.copy(File.DirAssets,"fs.txt",File.DirInternal,"fs.txt")
End If
lbl.TextSize = File.ReadString(File.DirInternal,"fs.txt")
lbl.Height = st.MeasureMultilineTextHeight(lbl,lbl.Text)
ScrollView1.Panel.Height = st.MeasureMultilineTextHeight(lbl,lbl.Text)
fontsize.Add("اندازه فونت")
For i = 21 To 55
fontsize.Add(i)
Next
Dim verticalPosition As String = "bottom" '"top" or "bottom"
Dim horizontalPosition As String = "center" '"left", "right" or "center"
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
File.WriteString(File.DirInternal,"fs.txt",lbl.TextSize)
End Sub
'Sub copy_Click
' s.SetClipboardText(lbl.Text)
' ToastMessageShow("کپی شد!",False)
'End Sub
Sub fontsize_ItemClick (Position As Int, Value As Object)
If Position = 0 Then
lbl.TextSize = 20
Else
lbl.TextSize = Position
End If
lbl.Height = st.MeasureMultilineTextHeight(lbl,lbl.Text)
ScrollView1.Panel.Height = st.MeasureMultilineTextHeight(lbl,lbl.Text)
End Sub
Sub share_Click
StartActivity(s.ShareText(lbl.Text,"ارسال توسط :"))
End Sub
Sub load
End Sub
Sub Button1_Click
num = meghdar+1
meghdar = num
End Sub
Sub Button2_Click
num = meghdar-1
meghdar = num
End Sub
سوال
parham01 82
سلام یه سورس دارم برای نمایش اطلاعات دیتابیس
میخوام button_1 و 2
وفتی کلیک میشن یک واحد به meghdar تو اکتیویتی اضافه یا کم بشه
(آخر سورس یه چیزایی نوشتم ولی کار نکرد)
سورس :
#Region Activity Attributes #FullScreen: true #IncludeTitle: false #End Region Sub Process_Globals Dim num As Int Dim sql2 As SQL Dim meghdar As Int End Sub Sub Globals Dim st As StringUtils Private ScrollView1 As ScrollView Private lbl As Label Dim fara As Farakhani Dim cur As Cursor Private share As Button Private fontsize As Spinner Private copy As Button Dim s As AriaLib Private Label1 As Label End Sub Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("reading") ScrollView1.Panel.LoadLayout("text") Activity.Color = Colors.RGB(221,81,130) lbl.Gravity = Gravity.CENTER lbl.TextColor = Colors.White lbl.TextSize = 25 lbl.Typeface = Typeface.LoadFromAssets("W_yekan Bold_p30download.com_0.ttf") lbl.Height = -2 fara.FarakhaniMatn("khoon.db",sql2,cur,"SELECT * FROM tbl Where ID=",meghdar,lbl,"matn") ' fara.FarakhaniMatn("khoon.db",sql2,cur,"SELECT * FROM tbl Where ID=",meghdar,Label1,"name") If File.Exists(File.DirInternal,"fs.txt") = False Then File.copy(File.DirAssets,"fs.txt",File.DirInternal,"fs.txt") End If lbl.TextSize = File.ReadString(File.DirInternal,"fs.txt") lbl.Height = st.MeasureMultilineTextHeight(lbl,lbl.Text) ScrollView1.Panel.Height = st.MeasureMultilineTextHeight(lbl,lbl.Text) fontsize.Add("اندازه فونت") For i = 21 To 55 fontsize.Add(i) Next Dim verticalPosition As String = "bottom" '"top" or "bottom" Dim horizontalPosition As String = "center" '"left", "right" or "center" End Sub Sub Activity_Resume End Sub Sub Activity_Pause (UserClosed As Boolean) File.WriteString(File.DirInternal,"fs.txt",lbl.TextSize) End Sub 'Sub copy_Click ' s.SetClipboardText(lbl.Text) ' ToastMessageShow("کپی شد!",False) 'End Sub Sub fontsize_ItemClick (Position As Int, Value As Object) If Position = 0 Then lbl.TextSize = 20 Else lbl.TextSize = Position End If lbl.Height = st.MeasureMultilineTextHeight(lbl,lbl.Text) ScrollView1.Panel.Height = st.MeasureMultilineTextHeight(lbl,lbl.Text) End Sub Sub share_Click StartActivity(s.ShareText(lbl.Text,"ارسال توسط :")) End Sub Sub load End Sub Sub Button1_Click num = meghdar+1 meghdar = num End Sub Sub Button2_Click num = meghdar-1 meghdar = num End Sub
لینک ارسال
به اشتراک گذاری در سایت های دیگر
8 پاسخ به این سوال تاکنون داده شده است
ارسالهای توصیه شده
بایگانی شده
این موضوع بایگانی و قفل شده و دیگر امکان ارسال پاسخ نیست.