Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > it.comp.lang.visual-basic > #19363

Re: Texbox e stringa il risultato ?

From "Ettore" <ettor50@nomail.com>
Newsgroups it.comp.lang.visual-basic
Subject Re: Texbox e stringa il risultato ?
Date 2018-05-15 17:03 +0200
Organization A noiseless patient Spider
Message-ID <pdest1$dg0$1@dont-email.me> (permalink)
References <pd1h9s$pot$1@dont-email.me> <pd26c2$asr$1@dont-email.me> <pd3g63$dc5$1@gioia.aioe.org> <pd48h6$tqa$1@dont-email.me> <pddv7o$1eat$1@gioia.aioe.org>

Show all headers | View raw


RISOLTO
--------------------------------------------------------------------------
>"Sauro"  ha scritto nel messaggio news:pddv7o$1eat$1@gioia.aioe.org... Pur 
>non conoscendolo non posso credere che
>VB.NET non abbia una serie di funzioni standard.
>Ciao Ettore
>Sauro

>> Mi rimane sempre il problema di come fare a 1) Come fare a trovare il 
>> Giorno dell'anno dalla data inserita.
>> Bisestile e giorno dell'anno ...

>>In VB6 esiste la funzione Day(); in VB.NET non esiste una
>>serie di funzioni standard?
>>Ciao, Sauro
>

Risolto molti problemi posto il codice per condividerlo con tutti gli altri 
.
=================================================================
   Public Sub Button1_Click(sender As System.Object, e As System.EventArgs) 
Handles Button1.Click
       Dim giorno As Integer = Val(TextBox1.Text)
       Dim mese As Integer = Val(TextBox2.Text)
       Dim Anno As Integer = Val(TextBox3.Text)
       Dim Ora As Integer = Val(TextBox4.Text)
       Dim min As Integer = Val(TextBox5.Text)
       Dim sec As Integer = Val(TextBox6.Text)
       Dim secSS As Integer = Val(TextBox7.Text)
       Dim ycomp As Decimal
       Dim hhdec As Decimal

       ' Dim fuso As TimeZone = TimeZone.CurrentTimeZone
       '       Dim oralegale As System.Globalization.DaylightTime = 
fuso.GetDaylightChanges(Anno)
       ' Textbox X.text = Ora legale inizia " & oralegale.Start"
       ' Textbox X.text = Ora legale termina" & oralegale.End"

       ' ============== Variabili per Calcolo JD completo 
==================================================
       Dim I1cel As Decimal
       Dim calgreg As Decimal = 1582.1015
       Dim dAnno As Double
       Dim A As Decimal
       Dim A1 As Decimal
       Dim B As Decimal
       Dim B1 As Decimal
       Dim TDEC As Decimal
       Dim JDdayJUL As Decimal
       ' ================= Variabili per ggSettimana 
=======================================================
       Dim Ocell As Decimal
       Dim Lunedi As String
       Dim Martedi As String
       Dim Mercoledi As String
       Dim Giovedi As String
       Dim Venerdi As String
       Dim Sabato As String
       Dim Domenica As String

       ' ================ CONDIZIONI PRIMA DI FARE I CALCOLI, CONTROLLA 
====================================
       If TextBox3.Text = "" Then 
'Condizione per Anno e RANGE !
           MsgBox("Inserire anno Tra 1500 - 3500dc" & vbLf & "......CORREGGI 
!", MsgBoxStyle.Exclamation, "RANGE LIMIT")
           TextBox3.Focus()
       Else
           If TextBox3.Text < 1500 Then
               MsgBox("Inserire anno Tra 1500 - 3500dc" & vbLf & 
"......CORREGGI !", MsgBoxStyle.Exclamation, "ANNO RANGE LIMIT")
               TextBox3.Focus()
           End If
       End If
       If TextBox8.Text = "" Then 
'Condizione per Temperatura 0-70°
           MsgBox("Temperatura tra 0-70°" & vbLf & "......CORREGGI !", 
MsgBoxStyle.Exclamation, "TEMP° LIMITI")
           TextBox8.Focus()
       Else
       End If
       If TextBox9.Text = "" Then 
'Condizione per Temperatura 0-70°
           MsgBox("Atmosfera mBar Range 500 - 1200 Hpa/mBar°" & vbLf & 
"......CORREGGI !", MsgBoxStyle.Exclamation, "Atm. LIMITI")
           TextBox9.Focus()
       Else
           If TextBox9.Text < 500 Then 
'Condizione per Atmosfera Limite-
               MsgBox("Atmosfera mBar Range 500 - 1200 Hpa/mBar°" & vbLf & 
"......CORREGGI !", MsgBoxStyle.Exclamation, "Atm. LIMITI")
               TextBox9.Focus()
           End If
       End If

       ' ========================= INIZIO CALCOLI 
==========================================================
       ' ==================== CALCOLO GIORNO GIULIANO MINORE PER ARRIVARE AL 
GIORNO DELLA SETTIMANA=========
       If mese > 2 Then
           Anno = Anno And mese = mese
       End If
       If mese <= 2 Then
           Anno = Anno - 1
           mese = mese + 12
       End If
       If Anno < calgreg Then
           A = 0
           B = 0
       End If
       If Anno >= calgreg Then
           A = Int(Anno / 100)
           B = 2 - A + Int(A / 4)
       End If
       Ocell = Int(365.25 * (Anno + 4716)) + Int(30.6001 * (mese + 1)) + 
giorno + B - 1524.5
       '       TextBox10.Text = Round(Ocell, 6)    USATO x Test

       ' ================== DA SOPRA CALCOLA JD MINORE E ARRIVO AL GIORNO 
DELLA SETTIMANA DA ALGORITMO.=====
       Dim ggSett As String
       If (((Ocell + 0.5) Mod 7) = 0) Then
           ggSett = "Lunedi"
       End If
       If (((Ocell + 0.5) Mod 7) = 1) Then
           ggSett = "Martedi"
       End If
       If (((Ocell + 0.5) Mod 7) = 2) Then
           ggSett = "Mercoledi"
       End If
       If (((Ocell + 0.5) Mod 7) = 3) Then
           ggSett = "Giovedi"
       End If
       If (((Ocell + 0.5) Mod 7) = 4) Then
           ggSett = "Venerdi"
       End If
       If (((Ocell + 0.5) Mod 7) = 5) Then
           ggSett = "Sabato"
       End If
       If (((Ocell + 0.5) Mod 7) = 6) Then
           ggSett = "Domenica"
       End If
       TextBox10.Text = ggSett

       ' ========================= CALCOLA SE ANNO E BISESTILE 
==============================================
       ' 
=(SE(O(RESTO(Anno;400)=0;E(RESTO(Anno;4)=0;RESTO(Anno;100)<>0));"SI"; "NO"))
       Dim gbisxt As Integer = CInt(TextBox3.Text)
       If Date.IsLeapYear(gbisxt) = True Then
           TextBox11.Text = "SI"
       Else
           TextBox11.Text = "NO"
       End If

       ' ========================= CALCOLO numero giorno nell'ANNO 
===================================================
       Dim ggnoY As Integer
       Dim dataSer As Date = DateSerial(Anno, mese, giorno)
       ggnoY = DatePart(DateInterval.DayOfYear, dataSer)
       TextBox12.Text = ggnoY

       ' ========================= Calcolo Numero giorni contenuti in anno 
=================================
       Dim numDayear As Decimal
       If (Anno Mod 400) = 0 Then
           numDayear = 366
       End If
       If (Anno Mod 100) = 0 Then
           numDayear = 365
       End If
       If (Anno Mod 4) = 0 Then
           numDayear = 366
       Else
           numDayear = 365
       End If
       TextBox13.Text = numDayear

       ' ==================== Calcola numero giorni a fine anno 
============================================
       Dim ggiFineAnno As Decimal
       ggiFineAnno = (numDayear - ggnoY)
       TextBox14.Text = ggiFineAnno

       ' ============== Calcolo Numero Settimana dell'Anno 
===================[settimana/txtsettimana]====OK
       Dim numSett As Double
       TextBox15.Text = Int(ggnoY / 7)
=================================================
Sistema Operativo Windows 7 64b
MS Visual Studio 2017.enterpr. -v.15.7.1 - MSNET:4.7.02558.


Grazie per ogni consiglio che date, condivido per aiutare chi ha bisogno.
Ettore

Back to it.comp.lang.visual-basic | Previous | NextPrevious in thread | Find similar


Thread

Texbox e stringa il risultato ? "Ettore" <ettor50@nomail.com> - 2018-05-10 15:26 +0200
  Re: Texbox e stringa il risultato ? "Ettore" <ettor50@nomail.com> - 2018-05-10 21:25 +0200
    Re: Texbox e stringa il risultato ? "Sauro" <vicchi@crsscala.it> - 2018-05-11 09:19 +0200
      Re: Texbox e stringa il risultato ? "Ettore" <ettor50@nomail.com> - 2018-05-11 16:14 +0200
        Re: Texbox e stringa il risultato ? "Sauro" <vicchi@crsscala.it> - 2018-05-15 08:37 +0200
          Re: Texbox e stringa il risultato ? "Ettore" <ettor50@nomail.com> - 2018-05-15 17:03 +0200

csiph-web