1
Programmazione / Re:creazione colonna in columnview
« il: 20 Febbraio 2024, 18:13:34 »
Forse questo semplice programma vi aiuterà.
19/05/2023: A causa di un errore sono stati cancellati, insieme ad account creati da bot, alcuni account legittimi. Si prega di leggere qui: https://www.gambas-it.org/smf/index.php?topic=9733.0
Questa sezione ti permette di visualizzare tutti i post inviati da questo utente. N.B: puoi vedere solo i post relativi alle aree dove hai l'accesso.
sudo add-apt-repository -y ppa:gambas-team/gambas3 && sudo apt-get update && sudo apt-get -y install gambas3
Dim sCPU As String
Shell "lscpu | grep 'Model name:'" To sCPU
sCPU = Trim(Replace(sCPU, "Model name:", ""))
Print sCPU
' Gambas class file
ListView1 As ListView
Label1 As Label
Public Sub Form_Open()
BuildForm
End
Public Sub BuildForm()
Dim sText As String[] = ["Questa", "volta", "mi", "trovo", "a", "voler", "contare", "lo", "faccia"]
Dim iLoop As Integer
With Me
.Arrangement = Arrange.Vertical
.H = 400
.W = 500
.Padding = 5
End With
With ListView1 = New ListView(Me) As "ListView1"
.Expand = True
.ShowCheck = True
.Mode = Select.Multiple
End With
For iLoop = 0 To sText.Max
ListView1.Add(Str(iLoop), sText[iLoop])
Next
With Label1 = New Label(Me) As "Label1"
.H = 28
.W = 100
.Font.Bold = True
.Alignment = Align.Center
End With
End
Public Sub ListView1_Select()
Label1.Text = Str(ListView1.Selection.Count)
End
Public Sub Form_Open()
Print GetKIP("===== 23.8.1.1 Progetto Diagramma In Linea =====")
Print GetKIP("===== 1 Primo Capitolo =====")
Print GetKIP("===== 1.2.1 Qualsiasi cosa =====")
Print GetKIP("===== 12.21.1.15 Qualsiasi cosa =====")
End
Public Sub GetKIP(sLine As String) As String
Dim sNew, sWork As String
Dim iLoop, iLetter As Integer
Dim sHold As New String[]
For iLetter = 1 To Len(sLine)
If IsNumber(Mid(sLine, iLetter, 1)) Then sWork &= Mid(sLine, iLetter, 1)
Next
sWork = "k" & sWork
sHold = Split(sWork, ".")
For iLoop = 0 To sHold.Max
If iLoop = 0 Then sNew &= sHold[0] & "/"
If iLoop = 1 Then sNew &= sHold[0] & "." & sHold[1] & "/"
If iLoop = 2 Then sNew &= sHold[0] & "." & sHold[1] & "." & sHold[2] & "/"
If iLoop = 3 Then sNew &= sHold[0] & "." & sHold[1] & "." & sHold[2] & "." & sHold[3] & "/"
Next
Return Left(sNew, -1)
End
ToggleButton1 As ToggleButton
Public Sub Form_Open()
With Me
.Height = 50
.Width = 220
.Padding = 5
.Arrangement = Arrange.None
.Center
End With
With ToggleButton1 = New ToggleButton(Me) As "ToggleButton1"
.Text = "&Installazione PostgreSQL"
.X = 10
.Y = 10
.Height = 28
.Width = 200
.Picture = Picture["icon:/22/text"]
End With
If Not Component.IsLoaded("gb.desktop") Then Component.Load("gb.desktop")
End
Public Sub ToggleButton1_Click()
If ToggleButton1.Value = True Then Desktop.Open("https://www.gambas-it.org/wiki/index.php?title=Installazione_Server_PostgreSQL")
End
Public Sub Form_Open()
Dim sResult As String
Dim iLoop As Integer
Dim sSoftware As String[] = ["libreoffice", "word"]
For iLoop = 0 To sSoftware.Max
Shell "man " & sSoftware[iloop] To sResult
If sResult = "" Then Print sSoftware[iloop] & " non installato" Else Print sSoftware[iloop] & " installato"
Next
End
Public Sub Form_Open()
Dim sData As String
Dim wFile As String = User.Home &/ "Music/Baz Lurhman - Sunscreen.mp3"
Shell "mediainfo --Inform='Audio;%Duration%' " & Chr(34) & wfile & Chr(34) To sData
Print sData
End
GridView1 As GridView
Public Sub Form_Open()
Dim aStringhe As String[] = ["DESCRIZIONE", "PREZZO", "", "", "Chiave inglese", "11,20", "Ferro da stiro a vapore", "32,40", "Macchinetta da caffè per cialde", "112,00", "Aermacchi bicilindrica 1953", "7.500,00"]
Dim iLoop, iRow As Integer
With Me
.padding = 5
.Height = 150
.Width = 300
.Arrangement = Arrange.Vertical
End With
With GridView1 = New GridView(Me) As "GridView1"
.Clear
.Expand = True
.Grid = False
.Rows.Count = aStringhe.Count / 2
.Columns.Count = 3
End With
For iLoop = 0 To aStringhe.Max Step 2
GridView1[iRow, 0].Text = aStringhe[iLoop]
GridView1[iRow, 1].Text = aStringhe[iLoop + 1]
GridView1[iRow, 1].Alignment = Align.Right
Inc iRow
Next
GridView1.Columns.Width = -1
End
Public Sub Timer1_Timer()
Dim sTempo As String = Str(Time(Now))
sTempo = Trim(Replace(sTempo, "/", ""))
If sTempo = "17:29:00" Then InviaEmail
End