archangel48
New Member
How to save background color from checkbox for when apps exit background color still with color whats choose.
Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private Biru As RadioButton
Private Exit As Button
Private Hijau As RadioButton
Private Label1 As Label
Private Merah As RadioButton
Private Pembagian As Button
Private Penjumlahan As Button
Private Perkalian As Button
Private EditText1 As EditText
Private EditText2 As EditText
Private jumlah, Nilai1, Nilai2 As Int
Private kvs As KeyValueStore
End Sub
Public Sub Initialize
' B4XPages.GetManager.LogEvents = True
End Sub
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
xui.SetDataFolder("kvs")
kvs.Initialize(xui.DefaultFolder,"kvs.dat")
EditText1.Text = kvs.Get("tulisan1")
Root.Color = kvs.("warna")
End Sub
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
Private Sub Button1_Click
xui.MsgboxAsync("Hello world!", "B4X")
End Sub
Private Sub Label1_Bima_19
End Sub
Private Sub Perkalian_Bima_19_Click
If EditText1.Text ="" And EditText2.Text ="" Then
xui.MsgboxAsync("Input Text harus diisi","Peringatan !")
Else
Nilai1 = EditText1.Text
Nilai2 = EditText2.Text
jumlah = (Nilai1 * Nilai2)
Label1.Text=jumlah
End If
End Sub
Private Sub Penjumlahan_Bima_19_Click
If EditText1.Text ="" And EditText2.Text ="" Then
xui.MsgboxAsync("Input Text harus diisi","Peringatan !")
Else
Nilai1 = EditText1.Text
Nilai2 = EditText2.Text
jumlah = (Nilai1 + Nilai2)
Label1.Text=jumlah
End If
End Sub
Private Sub Pembagian_Bima_19_Click
If EditText1.Text ="" And EditText2.Text ="" Then
xui.MsgboxAsync("Input Text harus diisi","Peringatan !")
Else
Nilai1 = EditText1.Text
Nilai2 = EditText2.Text
jumlah = (Nilai1 / Nilai2)
Label1.Text=jumlah
End If
End Sub
Private Sub RadioMerah_Bima_19_CheckedChange(Checked As Boolean)
Root.Color = Colors.Red
End Sub
Private Sub RadioHijau_Bima_19_CheckedChange(Checked As Boolean)
Root.Color = Colors.Green
End Sub
Private Sub RadioBiru_Bima_19_CheckedChange(Checked As Boolean)
Root.Color = Colors.Blue
End Sub
Private Sub Exit_Bima_19_Click
kvs.Put("tulisan1", EditText1.Text)
Log(kvs.Get("tulisan1"))
ExitApplication
End Sub
Private Sub B4XPage_Background
kvs.Put("tulisan1", EditText1.Text)
Log(kvs.Get("tulisan1"))
End Sub
Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private Biru As RadioButton
Private Exit As Button
Private Hijau As RadioButton
Private Label1 As Label
Private Merah As RadioButton
Private Pembagian As Button
Private Penjumlahan As Button
Private Perkalian As Button
Private EditText1 As EditText
Private EditText2 As EditText
Private jumlah, Nilai1, Nilai2 As Int
Private kvs As KeyValueStore
End Sub
Public Sub Initialize
' B4XPages.GetManager.LogEvents = True
End Sub
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
xui.SetDataFolder("kvs")
kvs.Initialize(xui.DefaultFolder,"kvs.dat")
EditText1.Text = kvs.Get("tulisan1")
Root.Color = kvs.("warna")
End Sub
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
Private Sub Button1_Click
xui.MsgboxAsync("Hello world!", "B4X")
End Sub
Private Sub Label1_Bima_19
End Sub
Private Sub Perkalian_Bima_19_Click
If EditText1.Text ="" And EditText2.Text ="" Then
xui.MsgboxAsync("Input Text harus diisi","Peringatan !")
Else
Nilai1 = EditText1.Text
Nilai2 = EditText2.Text
jumlah = (Nilai1 * Nilai2)
Label1.Text=jumlah
End If
End Sub
Private Sub Penjumlahan_Bima_19_Click
If EditText1.Text ="" And EditText2.Text ="" Then
xui.MsgboxAsync("Input Text harus diisi","Peringatan !")
Else
Nilai1 = EditText1.Text
Nilai2 = EditText2.Text
jumlah = (Nilai1 + Nilai2)
Label1.Text=jumlah
End If
End Sub
Private Sub Pembagian_Bima_19_Click
If EditText1.Text ="" And EditText2.Text ="" Then
xui.MsgboxAsync("Input Text harus diisi","Peringatan !")
Else
Nilai1 = EditText1.Text
Nilai2 = EditText2.Text
jumlah = (Nilai1 / Nilai2)
Label1.Text=jumlah
End If
End Sub
Private Sub RadioMerah_Bima_19_CheckedChange(Checked As Boolean)
Root.Color = Colors.Red
End Sub
Private Sub RadioHijau_Bima_19_CheckedChange(Checked As Boolean)
Root.Color = Colors.Green
End Sub
Private Sub RadioBiru_Bima_19_CheckedChange(Checked As Boolean)
Root.Color = Colors.Blue
End Sub
Private Sub Exit_Bima_19_Click
kvs.Put("tulisan1", EditText1.Text)
Log(kvs.Get("tulisan1"))
ExitApplication
End Sub
Private Sub B4XPage_Background
kvs.Put("tulisan1", EditText1.Text)
Log(kvs.Get("tulisan1"))
End Sub