Kalender Monatsansicht errechnen

  • VB.NET

SSL ist deaktiviert! Aktivieren Sie SSL für diese Sitzung, um eine sichere Verbindung herzustellen.

Es gibt 9 Antworten in diesem Thema. Der letzte Beitrag () ist von ErfinderDesRades.

    Kalender Monatsansicht errechnen

    Guten Abend Leute,
    Ich würde gerne fragen wie ich die Monatsansicht eines Kalenders errechnen kann. Ich habe einen Kalender erstellt der größten Teils funktioniert. Nur habe ich das Problem dass ich nicht weiß wie ich die Monatsansicht ausrechnen lasse ich habe die Variablen: Schaltjahr ist ein Boolean und Anzahltage ist ein Integer.
    Bei Schaltjahr wird ausgerechnet ob es ein Schaltjahr ist und bei Anzahltage wird errechnet Wie viele Tage ein Monat hat. Dazu habe ich noch die Label: Label1x1 bis Label1x7 und das wiederum bis Label5x7 und auch noch Label6x1 bis Label6x2.

    EDIT: Tagesansicht zu Monatsansicht geändert
    if Brain.Enabled = False Then
    Process.start("C:\Brain.exe")
    End if
    __________________________________________________

    Error: Brain.exe not found System shut down

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „Toni03“ ()

    @Toni03 Du hast doch noch das Jahr.
    Wie soll denn diese Tagesansicht aussehen bzw. was soll sie beinhalten?
    Falls Du diesen Code kopierst, achte auf die C&P-Bremse.
    Jede einzelne Zeile Deines Programms, die Du nicht explizit getestet hast, ist falsch :!:
    Ein guter .NET-Snippetkonverter (der ist verfügbar).
    VB-Fragen über PN / Konversation werden ignoriert!
    Entschuldige ich meinte die Monatsübersicht habe es jetzt geändert. Ich habe ein Bild angehängt das alles erklären müsste
    Bilder
    • Monatsansicht.PNG

      17,12 kB, 956×549, 17 mal angesehen
    if Brain.Enabled = False Then
    Process.start("C:\Brain.exe")
    End if
    __________________________________________________

    Error: Brain.exe not found System shut down
    @Toni03 OK.
    1. des Monats, Wochentag ermitteln,
    von Montag bis zum 0. des Monats Leerzeichen (wenn Montag, dann keine),
    dann bis zum Ultimo modulo 7 die Zeilen füllen.
    Wo ist das Problem?
    Falls Du diesen Code kopierst, achte auf die C&P-Bremse.
    Jede einzelne Zeile Deines Programms, die Du nicht explizit getestet hast, ist falsch :!:
    Ein guter .NET-Snippetkonverter (der ist verfügbar).
    VB-Fragen über PN / Konversation werden ignoriert!
    Ich verstehe gerade leider gar nichts von dem wo du schreibst.
    if Brain.Enabled = False Then
    Process.start("C:\Brain.exe")
    End if
    __________________________________________________

    Error: Brain.exe not found System shut down
    @Toni03 Wie bist Du denn zu dem Bilde gekommen?
    Oder
    Willst Du Dir von uns die Arbeit machen lassen, ohne was davon zu verstehen?
    Ultimo ist der Letzte Tag des Monats.
    Modulo 7, weil die Woche 7 Tage hat.
    Falls Du diesen Code kopierst, achte auf die C&P-Bremse.
    Jede einzelne Zeile Deines Programms, die Du nicht explizit getestet hast, ist falsch :!:
    Ein guter .NET-Snippetkonverter (der ist verfügbar).
    VB-Fragen über PN / Konversation werden ignoriert!
    Achso Jetzt Verstehe ich das. Soweit habe ich den Code Jetzt geschrieben das er mir diesen Monat ausrechnet. Aber ich habe keine Ahnung wie das klappen könnte mit zum Beispiel nächstem Monat.

    Spoiler anzeigen

    Quellcode

    1. ​ Dim Anzahltage As Integer
    2. TagderWoche = Now.DayOfWeek
    3. Tagheute = Now.Day
    4. Dim SchaltjahrRe As String = Jahr / 4
    5. Dim Schaltjahr As Boolean
    6. If SchaltjahrRe.Contains(",") Then
    7. Schaltjahr = False
    8. Else
    9. Schaltjahr = True
    10. End If
    11. If Monat = 1 Or Monat = 3 Or Monat = 5 Or Monat = 7 Or Monat = 8 Or Monat = 10 Or Monat = 12 Then
    12. Anzahltage = 31
    13. ElseIf Monat = 4 Or Monat = 6 Or Monat = 9 Or Monat = 11 Then
    14. Anzahltage = 30
    15. ElseIf Monat = 2 Then
    16. If Schaltjahr = True Then
    17. Anzahltage = 29
    18. Else
    19. Anzahltage = 28
    20. End If
    21. End If
    22. If Now.Day = Tage Then
    23. Do While Tage > 1
    24. Tage = Tage - 1
    25. TagderWoche = TagderWoche - 1
    26. If TagderWoche = 0 Then
    27. TagderWoche = 7
    28. End If
    29. Loop
    30. ElseIf Now.Month > Monat And Now.Year > Jahr Then
    31. ElseIf Now.Year > jahr And Now.Month < Monat Then
    32. ElseIf Now.Year < Jahr And Now.Month > Monat Then
    33. ElseIf Now.Year < Jahr And Now.Month < Monat Then
    34. ElseIf Now.Year = Jahr And Now.Month < Monat Then
    35. ElseIf Now.Year = Jahr And Now.Month > Monat Then
    36. Dim Monthsave As Integer = Now.Month
    37. Do While Tage > 1
    38. Tage = Tage - 1
    39. TagderWoche = TagderWoche - 1
    40. If TagderWoche = 0 Then
    41. TagderWoche = 7
    42. End If
    43. Loop
    44. End If
    45. If TagderWoche = 1 Then
    46. Label1x1.Visible = True
    47. Label1x2.Visible = True
    48. Label1x3.Visible = True
    49. Label1x4.Visible = True
    50. Label1x5.Visible = True
    51. Label1x6.Visible = True
    52. Label1x7.Visible = True
    53. Label2x1.Visible = True
    54. Label2x2.Visible = True
    55. Label2x3.Visible = True
    56. Label2x4.Visible = True
    57. Label2x5.Visible = True
    58. Label2x6.Visible = True
    59. Label2x7.Visible = True
    60. Label3x1.Visible = True
    61. Label3x2.Visible = True
    62. Label3x3.Visible = True
    63. Label3x4.Visible = True
    64. Label3x5.Visible = True
    65. Label3x6.Visible = True
    66. Label3x7.Visible = True
    67. Label4x1.Visible = True
    68. Label4x2.Visible = True
    69. Label4x3.Visible = True
    70. Label4x4.Visible = True
    71. Label4x5.Visible = True
    72. Label4x6.Visible = True
    73. Label4x7.Visible = True
    74. Label5x1.Visible = True
    75. Label5x2.Visible = True
    76. Label5x3.Visible = True
    77. Label5x4.Visible = True
    78. Label5x5.Visible = True
    79. Label5x6.Visible = True
    80. Label5x7.Visible = True
    81. Label6x1.Visible = True
    82. Label6x2.Visible = True
    83. Label1x1.Text = "01"
    84. Label1x2.Text = "02"
    85. Label1x3.Text = "03"
    86. Label1x4.Text = "04"
    87. Label1x5.Text = "05"
    88. Label1x6.Text = "06"
    89. Label1x7.Text = "07"
    90. Label2x1.Text = "08"
    91. Label2x2.Text = "09"
    92. Label2x3.Text = "10"
    93. Label2x4.Text = "11"
    94. Label2x5.Text = "12"
    95. Label2x6.Text = "13"
    96. Label2x7.Text = "14"
    97. Label3x1.Text = "15"
    98. Label3x2.Text = "16"
    99. Label3x3.Text = "17"
    100. Label3x4.Text = "18"
    101. Label3x5.Text = "19"
    102. Label3x6.Text = "20"
    103. Label3x7.Text = "21"
    104. Label4x1.Text = "22"
    105. Label4x2.Text = "23"
    106. Label4x3.Text = "24"
    107. Label4x4.Text = "25"
    108. Label4x5.Text = "26"
    109. Label4x6.Text = "27"
    110. Label4x7.Text = "28"
    111. Label5x1.Text = "29"
    112. Label5x2.Text = "30"
    113. Label5x3.Text = "31"
    114. Label5x4.Visible = False
    115. Label5x5.Visible = False
    116. Label5x6.Visible = False
    117. Label5x7.Visible = False
    118. Label6x1.Visible = False
    119. Label6x2.Visible = False
    120. If Anzahltage = 30 Then
    121. Label5x3.Visible = False
    122. ElseIf Anzahltage = 29 Then
    123. Label5x3.Visible = False
    124. Label5x2.Visible = False
    125. ElseIf Anzahltage = 28 Then
    126. Label5x3.Visible = False
    127. Label5x2.Visible = False
    128. Label5x1.Visible = False
    129. End If
    130. ElseIf TagderWoche = 2 Then
    131. Label1x1.Visible = True
    132. Label1x2.Visible = True
    133. Label1x3.Visible = True
    134. Label1x4.Visible = True
    135. Label1x5.Visible = True
    136. Label1x6.Visible = True
    137. Label1x7.Visible = True
    138. Label2x1.Visible = True
    139. Label2x2.Visible = True
    140. Label2x3.Visible = True
    141. Label2x4.Visible = True
    142. Label2x5.Visible = True
    143. Label2x6.Visible = True
    144. Label2x7.Visible = True
    145. Label3x1.Visible = True
    146. Label3x2.Visible = True
    147. Label3x3.Visible = True
    148. Label3x4.Visible = True
    149. Label3x5.Visible = True
    150. Label3x6.Visible = True
    151. Label3x7.Visible = True
    152. Label4x1.Visible = True
    153. Label4x2.Visible = True
    154. Label4x3.Visible = True
    155. Label4x4.Visible = True
    156. Label4x5.Visible = True
    157. Label4x6.Visible = True
    158. Label4x7.Visible = True
    159. Label5x1.Visible = True
    160. Label5x2.Visible = True
    161. Label5x3.Visible = True
    162. Label5x4.Visible = True
    163. Label5x5.Visible = True
    164. Label5x6.Visible = True
    165. Label5x7.Visible = True
    166. Label6x1.Visible = True
    167. Label6x2.Visible = True
    168. Label1x2.Text = "01"
    169. Label1x3.Text = "02"
    170. Label1x4.Text = "03"
    171. Label1x5.Text = "04"
    172. Label1x6.Text = "05"
    173. Label1x7.Text = "06"
    174. Label2x1.Text = "07"
    175. Label2x2.Text = "08"
    176. Label2x3.Text = "09"
    177. Label2x4.Text = "10"
    178. Label2x5.Text = "11"
    179. Label2x6.Text = "12"
    180. Label2x7.Text = "13"
    181. Label3x1.Text = "14"
    182. Label3x2.Text = "15"
    183. Label3x3.Text = "16"
    184. Label3x4.Text = "17"
    185. Label3x5.Text = "18"
    186. Label3x6.Text = "19"
    187. Label3x7.Text = "20"
    188. Label4x1.Text = "21"
    189. Label4x2.Text = "22"
    190. Label4x3.Text = "23"
    191. Label4x4.Text = "24"
    192. Label4x5.Text = "25"
    193. Label4x6.Text = "26"
    194. Label4x7.Text = "27"
    195. Label5x1.Text = "28"
    196. Label5x2.Text = "29"
    197. Label5x3.Text = "30"
    198. Label5x4.Text = "31"
    199. Label1x1.Visible = False
    200. Label5x4.Visible = False
    201. Label5x5.Visible = False
    202. Label5x6.Visible = False
    203. Label5x7.Visible = False
    204. Label6x1.Visible = False
    205. Label6x2.Visible = False
    206. If Anzahltage = 30 Then
    207. Label5x4.Visible = False
    208. ElseIf Anzahltage = 29 Then
    209. Label5x3.Visible = False
    210. Label5x4.Visible = False
    211. ElseIf Anzahltage = 28 Then
    212. Label5x3.Visible = False
    213. Label5x2.Visible = False
    214. Label5x4.Visible = False
    215. End If
    216. ElseIf TagderWoche = 3 Then
    217. Label1x1.Visible = True
    218. Label1x2.Visible = True
    219. Label1x3.Visible = True
    220. Label1x4.Visible = True
    221. Label1x5.Visible = True
    222. Label1x6.Visible = True
    223. Label1x7.Visible = True
    224. Label2x1.Visible = True
    225. Label2x2.Visible = True
    226. Label2x3.Visible = True
    227. Label2x4.Visible = True
    228. Label2x5.Visible = True
    229. Label2x6.Visible = True
    230. Label2x7.Visible = True
    231. Label3x1.Visible = True
    232. Label3x2.Visible = True
    233. Label3x3.Visible = True
    234. Label3x4.Visible = True
    235. Label3x5.Visible = True
    236. Label3x6.Visible = True
    237. Label3x7.Visible = True
    238. Label4x1.Visible = True
    239. Label4x2.Visible = True
    240. Label4x3.Visible = True
    241. Label4x4.Visible = True
    242. Label4x5.Visible = True
    243. Label4x6.Visible = True
    244. Label4x7.Visible = True
    245. Label5x1.Visible = True
    246. Label5x2.Visible = True
    247. Label5x3.Visible = True
    248. Label5x4.Visible = True
    249. Label5x5.Visible = True
    250. Label5x6.Visible = True
    251. Label5x7.Visible = True
    252. Label6x1.Visible = True
    253. Label6x2.Visible = True
    254. Label1x3.Text = "01"
    255. Label1x4.Text = "02"
    256. Label1x5.Text = "03"
    257. Label1x6.Text = "04"
    258. Label1x7.Text = "05"
    259. Label2x1.Text = "06"
    260. Label2x2.Text = "07"
    261. Label2x3.Text = "08"
    262. Label2x4.Text = "09"
    263. Label2x5.Text = "10"
    264. Label2x6.Text = "11"
    265. Label2x7.Text = "12"
    266. Label3x1.Text = "13"
    267. Label3x2.Text = "14"
    268. Label3x3.Text = "15"
    269. Label3x4.Text = "16"
    270. Label3x5.Text = "17"
    271. Label3x6.Text = "18"
    272. Label3x7.Text = "19"
    273. Label4x1.Text = "20"
    274. Label4x2.Text = "21"
    275. Label4x3.Text = "22"
    276. Label4x4.Text = "23"
    277. Label4x5.Text = "24"
    278. Label4x6.Text = "25"
    279. Label4x7.Text = "26"
    280. Label5x1.Text = "27"
    281. Label5x2.Text = "28"
    282. Label5x3.Text = "29"
    283. Label5x4.Text = "30"
    284. Label5x5.Text = "31"
    285. Label1x1.Visible = False
    286. Label1x2.Visible = False
    287. Label5x6.Visible = False
    288. Label5x7.Visible = False
    289. Label6x1.Visible = False
    290. Label6x2.Visible = False
    291. If Anzahltage = 30 Then
    292. Label5x4.Visible = False
    293. ElseIf Anzahltage = 29 Then
    294. Label5x5.Visible = False
    295. Label5x4.Visible = False
    296. ElseIf Anzahltage = 28 Then
    297. Label5x3.Visible = False
    298. Label5x5.Visible = False
    299. Label5x4.Visible = False
    300. End If
    301. ElseIf TagderWoche = 4 Then
    302. Label1x1.Visible = True
    303. Label1x2.Visible = True
    304. Label1x3.Visible = True
    305. Label1x4.Visible = True
    306. Label1x5.Visible = True
    307. Label1x6.Visible = True
    308. Label1x7.Visible = True
    309. Label2x1.Visible = True
    310. Label2x2.Visible = True
    311. Label2x3.Visible = True
    312. Label2x4.Visible = True
    313. Label2x5.Visible = True
    314. Label2x6.Visible = True
    315. Label2x7.Visible = True
    316. Label3x1.Visible = True
    317. Label3x2.Visible = True
    318. Label3x3.Visible = True
    319. Label3x4.Visible = True
    320. Label3x5.Visible = True
    321. Label3x6.Visible = True
    322. Label3x7.Visible = True
    323. Label4x1.Visible = True
    324. Label4x2.Visible = True
    325. Label4x3.Visible = True
    326. Label4x4.Visible = True
    327. Label4x5.Visible = True
    328. Label4x6.Visible = True
    329. Label4x7.Visible = True
    330. Label5x1.Visible = True
    331. Label5x2.Visible = True
    332. Label5x3.Visible = True
    333. Label5x4.Visible = True
    334. Label5x5.Visible = True
    335. Label5x6.Visible = True
    336. Label5x7.Visible = True
    337. Label6x1.Visible = True
    338. Label6x2.Visible = True
    339. Label1x4.Text = "01"
    340. Label1x5.Text = "02"
    341. Label1x6.Text = "03"
    342. Label1x7.Text = "04"
    343. Label2x1.Text = "05"
    344. Label2x2.Text = "06"
    345. Label2x3.Text = "07"
    346. Label2x4.Text = "08"
    347. Label2x5.Text = "09"
    348. Label2x6.Text = "10"
    349. Label2x7.Text = "11"
    350. Label3x1.Text = "12"
    351. Label3x2.Text = "13"
    352. Label3x3.Text = "14"
    353. Label3x4.Text = "15"
    354. Label3x5.Text = "16"
    355. Label3x6.Text = "17"
    356. Label3x7.Text = "18"
    357. Label4x1.Text = "19"
    358. Label4x2.Text = "20"
    359. Label4x3.Text = "21"
    360. Label4x4.Text = "22"
    361. Label4x5.Text = "23"
    362. Label4x6.Text = "24"
    363. Label4x7.Text = "25"
    364. Label5x1.Text = "26"
    365. Label5x2.Text = "27"
    366. Label5x3.Text = "28"
    367. Label5x4.Text = "29"
    368. Label5x5.Text = "30"
    369. Label5x6.Text = "31"
    370. Label1x1.Visible = False
    371. Label1x2.Visible = False
    372. Label1x3.Visible = False
    373. Label5x6.Visible = False
    374. Label5x7.Visible = False
    375. Label6x1.Visible = False
    376. Label6x2.Visible = False
    377. If Anzahltage = 30 Then
    378. Label5x6.Visible = False
    379. ElseIf Anzahltage = 29 Then
    380. Label5x6.Visible = False
    381. Label5x5.Visible = False
    382. ElseIf Anzahltage = 28 Then
    383. Label5x6.Visible = False
    384. Label5x5.Visible = False
    385. Label5x4.Visible = False
    386. End If
    387. ElseIf TagderWoche = 5 Then
    388. Label1x1.Visible = True
    389. Label1x2.Visible = True
    390. Label1x3.Visible = True
    391. Label1x4.Visible = True
    392. Label1x5.Visible = True
    393. Label1x6.Visible = True
    394. Label1x7.Visible = True
    395. Label2x1.Visible = True
    396. Label2x2.Visible = True
    397. Label2x3.Visible = True
    398. Label2x4.Visible = True
    399. Label2x5.Visible = True
    400. Label2x6.Visible = True
    401. Label2x7.Visible = True
    402. Label3x1.Visible = True
    403. Label3x2.Visible = True
    404. Label3x3.Visible = True
    405. Label3x4.Visible = True
    406. Label3x5.Visible = True
    407. Label3x6.Visible = True
    408. Label3x7.Visible = True
    409. Label4x1.Visible = True
    410. Label4x2.Visible = True
    411. Label4x3.Visible = True
    412. Label4x4.Visible = True
    413. Label4x5.Visible = True
    414. Label4x6.Visible = True
    415. Label4x7.Visible = True
    416. Label5x1.Visible = True
    417. Label5x2.Visible = True
    418. Label5x3.Visible = True
    419. Label5x4.Visible = True
    420. Label5x5.Visible = True
    421. Label5x6.Visible = True
    422. Label5x7.Visible = True
    423. Label6x1.Visible = True
    424. Label6x2.Visible = True
    425. Label1x5.Text = "01"
    426. Label1x6.Text = "02"
    427. Label1x7.Text = "03"
    428. Label2x1.Text = "04"
    429. Label2x2.Text = "05"
    430. Label2x3.Text = "06"
    431. Label2x4.Text = "07"
    432. Label2x5.Text = "08"
    433. Label2x6.Text = "09"
    434. Label2x7.Text = "10"
    435. Label3x1.Text = "11"
    436. Label3x2.Text = "12"
    437. Label3x3.Text = "13"
    438. Label3x4.Text = "14"
    439. Label3x5.Text = "15"
    440. Label3x6.Text = "16"
    441. Label3x7.Text = "17"
    442. Label4x1.Text = "18"
    443. Label4x2.Text = "19"
    444. Label4x3.Text = "20"
    445. Label4x4.Text = "21"
    446. Label4x5.Text = "22"
    447. Label4x6.Text = "23"
    448. Label4x7.Text = "24"
    449. Label5x1.Text = "25"
    450. Label5x2.Text = "26"
    451. Label5x3.Text = "27"
    452. Label5x4.Text = "28"
    453. Label5x5.Text = "29"
    454. Label5x6.Text = "30"
    455. Label5x7.Text = "31"
    456. Label1x1.Visible = False
    457. Label1x2.Visible = False
    458. Label1x3.Visible = False
    459. Label1x4.Visible = False
    460. Label5x7.Visible = False
    461. Label6x1.Visible = False
    462. Label6x2.Visible = False
    463. If Anzahltage = 30 Then
    464. Label5x6.Visible = False
    465. ElseIf Anzahltage = 29 Then
    466. Label5x6.Visible = False
    467. Label5x5.Visible = False
    468. ElseIf Anzahltage = 28 Then
    469. Label5x6.Visible = False
    470. Label5x5.Visible = False
    471. Label5x4.Visible = False
    472. End If
    473. ElseIf TagderWoche = 6 Then
    474. Label1x1.Visible = True
    475. Label1x2.Visible = True
    476. Label1x3.Visible = True
    477. Label1x4.Visible = True
    478. Label1x5.Visible = True
    479. Label1x6.Visible = True
    480. Label1x7.Visible = True
    481. Label2x1.Visible = True
    482. Label2x2.Visible = True
    483. Label2x3.Visible = True
    484. Label2x4.Visible = True
    485. Label2x5.Visible = True
    486. Label2x6.Visible = True
    487. Label2x7.Visible = True
    488. Label3x1.Visible = True
    489. Label3x2.Visible = True
    490. Label3x3.Visible = True
    491. Label3x4.Visible = True
    492. Label3x5.Visible = True
    493. Label3x6.Visible = True
    494. Label3x7.Visible = True
    495. Label4x1.Visible = True
    496. Label4x2.Visible = True
    497. Label4x3.Visible = True
    498. Label4x4.Visible = True
    499. Label4x5.Visible = True
    500. Label4x6.Visible = True
    501. Label4x7.Visible = True
    502. Label5x1.Visible = True
    503. Label5x2.Visible = True
    504. Label5x3.Visible = True
    505. Label5x4.Visible = True
    506. Label5x5.Visible = True
    507. Label5x6.Visible = True
    508. Label5x7.Visible = True
    509. Label6x1.Visible = True
    510. Label6x2.Visible = True
    511. Label1x6.Text = "01"
    512. Label1x7.Text = "02"
    513. Label2x1.Text = "03"
    514. Label2x2.Text = "04"
    515. Label2x3.Text = "05"
    516. Label2x4.Text = "06"
    517. Label2x5.Text = "07"
    518. Label2x6.Text = "08"
    519. Label2x7.Text = "09"
    520. Label3x1.Text = "10"
    521. Label3x2.Text = "11"
    522. Label3x3.Text = "12"
    523. Label3x4.Text = "13"
    524. Label3x5.Text = "14"
    525. Label3x6.Text = "15"
    526. Label3x7.Text = "16"
    527. Label4x1.Text = "17"
    528. Label4x2.Text = "18"
    529. Label4x3.Text = "19"
    530. Label4x4.Text = "20"
    531. Label4x5.Text = "21"
    532. Label4x6.Text = "22"
    533. Label4x7.Text = "23"
    534. Label5x1.Text = "24"
    535. Label5x2.Text = "25"
    536. Label5x3.Text = "26"
    537. Label5x4.Text = "27"
    538. Label5x5.Text = "28"
    539. Label5x6.Text = "29"
    540. Label5x7.Text = "30"
    541. Label6x1.Text = "31"
    542. Label1x1.Visible = False
    543. Label1x2.Visible = False
    544. Label1x3.Visible = False
    545. Label1x4.Visible = False
    546. Label5x7.Visible = False
    547. Label6x1.Visible = False
    548. Label6x2.Visible = False
    549. If Anzahltage = 30 Then
    550. Label6x1.Visible = False
    551. ElseIf Anzahltage = 29 Then
    552. Label6x1.Visible = False
    553. Label5x7.Visible = False
    554. ElseIf Anzahltage = 28 Then
    555. Label6x1.Visible = False
    556. Label5x7.Visible = False
    557. Label5x6.Visible = False
    558. End If
    559. ElseIf TagderWoche = 7 Then
    560. Label1x1.Visible = True
    561. Label1x2.Visible = True
    562. Label1x3.Visible = True
    563. Label1x4.Visible = True
    564. Label1x5.Visible = True
    565. Label1x6.Visible = True
    566. Label1x7.Visible = True
    567. Label2x1.Visible = True
    568. Label2x2.Visible = True
    569. Label2x3.Visible = True
    570. Label2x4.Visible = True
    571. Label2x5.Visible = True
    572. Label2x6.Visible = True
    573. Label2x7.Visible = True
    574. Label3x1.Visible = True
    575. Label3x2.Visible = True
    576. Label3x3.Visible = True
    577. Label3x4.Visible = True
    578. Label3x5.Visible = True
    579. Label3x6.Visible = True
    580. Label3x7.Visible = True
    581. Label4x1.Visible = True
    582. Label4x2.Visible = True
    583. Label4x3.Visible = True
    584. Label4x4.Visible = True
    585. Label4x5.Visible = True
    586. Label4x6.Visible = True
    587. Label4x7.Visible = True
    588. Label5x1.Visible = True
    589. Label5x2.Visible = True
    590. Label5x3.Visible = True
    591. Label5x4.Visible = True
    592. Label5x5.Visible = True
    593. Label5x6.Visible = True
    594. Label5x7.Visible = True
    595. Label6x1.Visible = True
    596. Label6x2.Visible = True
    597. Label1x7.Text = "01"
    598. Label2x1.Text = "02"
    599. Label2x2.Text = "03"
    600. Label2x3.Text = "04"
    601. Label2x4.Text = "05"
    602. Label2x5.Text = "06"
    603. Label2x6.Text = "07"
    604. Label2x7.Text = "08"
    605. Label3x1.Text = "09"
    606. Label3x2.Text = "10"
    607. Label3x3.Text = "11"
    608. Label3x4.Text = "12"
    609. Label3x5.Text = "13"
    610. Label3x6.Text = "14"
    611. Label3x7.Text = "15"
    612. Label4x1.Text = "16"
    613. Label4x2.Text = "17"
    614. Label4x3.Text = "18"
    615. Label4x4.Text = "19"
    616. Label4x5.Text = "20"
    617. Label4x6.Text = "21"
    618. Label4x7.Text = "22"
    619. Label5x1.Text = "23"
    620. Label5x2.Text = "24"
    621. Label5x3.Text = "25"
    622. Label5x4.Text = "26"
    623. Label5x5.Text = "27"
    624. Label5x6.Text = "28"
    625. Label5x7.Text = "29"
    626. Label6x1.Text = "30"
    627. Label6x2.Text = "31"
    628. Label1x1.Visible = False
    629. Label1x2.Visible = False
    630. Label1x3.Visible = False
    631. Label1x4.Visible = False
    632. Label1x5.Visible = False
    633. Label6x1.Visible = False
    634. Label6x2.Visible = False
    635. If Anzahltage = 30 Then
    636. Label6x2.Visible = False
    637. ElseIf Anzahltage = 29 Then
    638. Label6x2.Visible = False
    639. Label6x1.Visible = False
    640. ElseIf Anzahltage = 28 Then
    641. Label5x7.Visible = False
    642. Label6x2.Visible = False
    643. Label6x1.Visible = False
    644. End If
    645. End If
    646. Tage = Now.Day
    647. End Sub

    if Brain.Enabled = False Then
    Process.start("C:\Brain.exe")
    End if
    __________________________________________________

    Error: Brain.exe not found System shut down
    @Toni03 Schmeiß Deinen Code weg.
    Sieh Dir mal die Member der Klasse Date an, z.B.

    VB.NET-Quellcode

    1. Dim jahr = 2018
    2. Dim monat = 3
    3. Dim days As Integer = Date.DaysInMonth(jahr, monat)
    4. If Date.IsLapYear(jahr) Then
    5. MessageBox("Schaltjahr")
    6. End If
    Falls Du diesen Code kopierst, achte auf die C&P-Bremse.
    Jede einzelne Zeile Deines Programms, die Du nicht explizit getestet hast, ist falsch :!:
    Ein guter .NET-Snippetkonverter (der ist verfügbar).
    VB-Fragen über PN / Konversation werden ignoriert!

    RodFromGermany schrieb:

    If Date.IsLapYear(jahr) Then
    MessageBox("Schaltjahr")
    End If


    Da haut er mir bei dem mit Date einen Fehler raus habe auch geschaut IsLapYear ist keine Komponente von Date

    EDIT: Doch ist es habe es per Zufall entdeckt
    if Brain.Enabled = False Then
    Process.start("C:\Brain.exe")
    End if
    __________________________________________________

    Error: Brain.exe not found System shut down

    Toni03 schrieb:

    EDIT: Doch ist es habe es per Zufall entdeckt
    "Per Zufall" ist schlecht.
    Wenn jmd zu dir sagt "Schau dir ... an" solltest du genau wissen, was zu tun ist.
    Leider wird dabei meist nicht gesagt, wie "Anschauen" ühautp zu bewrkstelligen ist.
    also hier mal ein Video, wo man u.a. auch lernen kann, wie man ... "anschaut": VisualStudio richtig nutzen (Google ist nicht deine Mami)