Guide & Tutorial

  1. [VB.NET] Ottenere nomi My.Resources

    Avatar
    Tags
    VB.NET
    By en3rgizer il 14 Jan. 2014
    1 Comments   750 Views
    .
    CODICE
    Dim loEnumerator As IDictionaryEnumerator
           Dim loManager As Resources.ResourceManager
           Dim loReader As Resources.ResourceReader
           Dim lcName As String

           loManager = My.Resources.ResourceManager
           lcName = loManager.BaseName & ".resources"

           With Reflection.Assembly.GetExecutingAssembly
               loReader = New Resources.ResourceReader(.GetManifestResourceStream(lcName))
           End With

           loEnumerator = loReader.GetEnumerator

           While loEnumerator.MoveNext
               Debug.WriteLine(loEnumerator.Entry.Key.ToString & "  " & loEnumerator.Entry.Value.ToString)
           End While

           loReader.Close()
    Last Post by krausvampiro82 il 24 Nov. 2015
    .
  2. [VB.NET] Caricare Immagine da My.Resources in PictureBox

    Avatar
    Tags
    VB.NET
    By en3rgizer il 6 Jan. 2014
    0 Comments   208 Views
    .
    CODICE
    NomeImg = "Immagine_1"
    My.Resources.ResourceManager.GetObject(NomeImg)
    Last Post by en3rgizer il 6 Jan. 2014
    .
  3. [VB.NET] Integrare un file all'interno di un Progetto

    Avatar
    Tags
    VB.NET
    By en3rgizer il 7 Dec. 2012
    0 Comments   393 Views
    .
    Per integrare un file all'interno di un progetto basta importare il file nelle risorse per poi richiamarlo con l'oggetto My.Resources.

    Ecco come integrare un file:
    res

    Per utilizzare le risorse basta scrivere My.Resources.nome_risorsa, ad esempio:
    CODICE
    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
           PictureBox1.Image = My.Resources.Image001
       End Sub
    Last Post by en3rgizer il 7 Dec. 2012
    .
  4. [VB.NET] Modificare FormWindowState da codice

    Avatar
    Tags
    VB.NET
    By en3rgizer il 16 Sep. 2011
    0 Comments   135 Views
    .
    Tutto schermo:
    CODICE
    Form1.WindowState = FormWindowState.Maximized

    Normale:
    CODICE
    Form1.WindowState = FormWindowState.Normal

    Ridotta ad Icona
    CODICE
    Form1.WindowState = FormWindowState.Minimized

    Last Post by en3rgizer il 16 Sep. 2011
    .
  5. [VB.NET] Intercettare Si o No (MsgBox YesNo)

    Avatar
    Tags
    VB.NET
    By en3rgizer il 16 Sep. 2011
    0 Comments   409 Views
    .
    CODICE
    If MsgBox("Testo", MsgBoxStyle.YesNo, "Titolo") = DialogResult.Yes Then
          MsgBox("Hai cliccato SI!")
    Else
         MsgBox("Hai cliccato NO!")
    End If
    Last Post by en3rgizer il 16 Sep. 2011
    .
  6. [VB.NET] ProgressBar con Timer

    Avatar
    Tags
    VB.NET
    By en3rgizer il 16 Sep. 2011
    0 Comments   850 Views
    .
    Inserire un Timer e una ProgressBar nel Form, dopodiché fare doppio click sul Timer ed inserire questo codice:
    CODICE
    If ProgressBar1.Value < 100 Then
               ProgressBar1.Value += 1
           ElseIf ProgressBar1.Value = ProgressBar1.Maximum Then
               Timer1.Stop()
               MsgBox("Fine!")
           End If
    Last Post by en3rgizer il 16 Sep. 2011
    .
  7. [VB.NET] Usare i FolderBrowserDialog e OpenFileDialog

    Avatar
    Tags
    VB.NET
    By en3rgizer il 15 Sep. 2011
    0 Comments   1,569 Views
    .
    FolderBrowserDialog
    CODICE
    Dim folder As New FolderBrowserDialog
           If folder.ShowDialog = Windows.Forms.DialogResult.OK Then
               TextBox1.Text = folder.SelectedPath
           End If

    OpenFileDialog
    CODICE
    Dim folder As New OpenFileDialog
           If folder.ShowDialog = Windows.Forms.DialogResult.OK Then
               TextBox1.Text = folder.FileName
           End If
    Last Post by en3rgizer il 15 Sep. 2011
    .
  8. [VB.NET] Creare un Countdown

    Avatar
    Tags
    VB.NET
    By en3rgizer il 12 Sep. 2011
    0 Comments   1,073 Views
    .
    Creare un Form ed inserire: Un Timer e 4 Label (La 1° Label per i giorni, la 2° per le ore, la 3° per i minuti e la 4° per i secondi).
    Impostare le proprietà del Timer come nella figura sottostante:
    timerc

    Doppioclick sul Timer ed inserire questo codice:
    CODICE
    Dim giorno As New Date(2012, 12, 21, 00, 00, 0)
           Dim giorni_rimanenti As TimeSpan
           Dim adesso As Date = Now
           giorni_rimanenti = giorno.Subtract(adesso)
           Label1.Text = giorni_rimanenti.Days & " :"
           Label2.Text = giorni_rimanenti.Hours & " :"
           Label3.Text = giorni_rimanenti.Minutes & " :"
           Label4.Text = giorni_rimanenti.Seconds
       End Sub

    Esempio
    Countdown: 21 Dicembre 2012


    countdowna

    Last Post by en3rgizer il 12 Sep. 2011
    .
  9. [VB.NET] Dichiarare una variabile di tipo Date

    Avatar
    Tags
    VB.NET
    By en3rgizer il 12 Sep. 2011
    0 Comments   319 Views
    .
    CODICE
    Dim data As New Date(2011, 9, 17, 10, 30, 0)

    In questa maniera la variabile data conterrà il giorno 17 Settembre 2011 alle 10 e 30.
    Last Post by en3rgizer il 12 Sep. 2011
    .
  10. [VB.NET] Cambiare Font da codice

    Avatar
    Tags
    VB.NET
    By en3rgizer il 12 Sep. 2011
    0 Comments   2,475 Views
    .
    CODICE
    TextBox1.Font = New Font("Tahoma", 12, FontStyle.Bold)

    Last Post by en3rgizer il 12 Sep. 2011
    .