Hi
if i want to change the control text like button1.text to "b1" i do it like this
button1.text = "b1"
if i have now 10000 controls how could i do it short??
is it possible to get it from an excel file?
i have an excel file that in
col0 = type of the control
col1 = name ov the control
col2 = text of control (english)
col3 = text of control (german)
col4 = text of control (russian)
like this i want to make my app multilanguage
and if you cahnge the language it will get all control text from the excel file
i post a code how it should be, and a pic of my excel file maybe someone can help me
if i want to change the control text like button1.text to "b1" i do it like this
button1.text = "b1"
if i have now 10000 controls how could i do it short??
is it possible to get it from an excel file?
i have an excel file that in
col0 = type of the control
col1 = name ov the control
col2 = text of control (english)
col3 = text of control (german)
col4 = text of control (russian)
like this i want to make my app multilanguage
and if you cahnge the language it will get all control text from the excel file
i post a code how it should be, and a pic of my excel file maybe someone can help me
B4X:
Sub multilanguage
Dim workbook1 As ReadableWorkbook
Dim moviesSheet As ReadableSheet
workbook1.Initialize(File.DirAssets, "lang.xls")
moviesSheet = workbook1.GetSheet(0)
Dim col As Int
language = "English"'************ changeable
If language = "English" Then
col = 2
Else If language = "Deutsch" Then
col = 3
Else If language = "Russian" Then
col = 4
End If
Dim lanbutton As Button
Dim lanlabel As Label
Dim lanradio As RadioButton
Dim lancheck As CheckBox
For i = 2 To 1000
If moviesSheet.GetCellValue(0, i) = "Button" Then
lanbutton = moviesSheet.GetCellValue(1, i)
lanbutton.Text = moviesSheet.GetCellValue(col, i)
Else If moviesSheet.GetCellValue(0, i) = "Label" Then
lanlabel = moviesSheet.GetCellValue(1, i)
lanlabel.Text = moviesSheet.GetCellValue(col, i)
Else If moviesSheet.GetCellValue(0, i) = "RadioButton" Then
lanradio = moviesSheet.GetCellValue(1, i)
lanradio.Text = moviesSheet.GetCellValue(col, i)
Else If moviesSheet.GetCellValue(0, i) = "CheckBox " Then
lancheck = moviesSheet.GetCellValue(1, i)
lancheck.Text = moviesSheet.GetCellValue(col, i)
End If
Next
'day.Text = moviesSheet.GetCellValue(col, 2)
'txtl1.Text = moviesSheet.GetCellValue(col, 3)
'txtl2.Text = moviesSheet.GetCellValue(col, 4)
'txtl3.Text = moviesSheet.GetCellValue(col, 5)
'txtl4.Text = moviesSheet.GetCellValue(col, 6)
'txtl5.Text = moviesSheet.GetCellValue(col, 7)
'txtl6.Text = moviesSheet.GetCellValue(col, 8)
'txtl7.Text = moviesSheet.GetCellValue(col, 9)
'txtl8.Text = moviesSheet.GetCellValue(col, 10)
'txtl9.Text = moviesSheet.GetCellValue(col, 11)
'txtl10.Text = moviesSheet.GetCellValue(col, 12)
'txtl11.Text = moviesSheet.GetCellValue(col, 13)
'txtl12.Text = moviesSheet.GetCellValue(col, 14)
'txtl13.Text = moviesSheet.GetCellValue(col, 15)
'txtl14.Text = moviesSheet.GetCellValue(col, 16)
'txtl15.Text = moviesSheet.GetCellValue(col, 17)
'txtl16.Text = moviesSheet.GetCellValue(col, 18)
'txtl17.Text = moviesSheet.GetCellValue(col, 19)
'txtl18.Text = moviesSheet.GetCellValue(col, 20)
'txtl19.Text = moviesSheet.GetCellValue(col, 21)
'txtl20.Text = moviesSheet.GetCellValue(col, 22)
End Sub