Forum » Programiranje » [Visual basic] Open file dialog in preklic
[Visual basic] Open file dialog in preklic
roli ::
Torej po tem vodiču se učim programiranje in sem naletel na en problem. Namreč vse OK glede prikazovanja dialoga in to problem je kaj se zgodi, ko pritisnem na cancel v dialogu.V vodiču (link zgoraj) je napisano kaj bi moral naredit vendar to nekako ne deluje. Visual basic mi v primeru, da naredim to javi tale warning:
Napaka se nanaša na: DialogResult.Cancel
Še koda vsega skupaj:
Warning Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated. C:\Users\Roli\Documents\Visual Studio 2005\Projects\menus\menus\Form1.vb
Napaka se nanaša na: DialogResult.Cancel
Še koda vsega skupaj:
Private Sub OpenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenToolStripMenuItem.Click Dim filename As String Dim DidWork As Integer = OpenFD.ShowDialog() OpenFD.InitialDirectory = "C:\" OpenFD.Title = "Open file" OpenFD.Filter = "Text Files (*.txt)|*.txt" filename = OpenFD.FileName If DidWork = DialogResult.Cancel Then MsgBox("Cancel Button Clicked") Else filename = OpenFD.FileName MsgBox(filename) End If MessageBox.Show(filename) End Sub
http://www.r00li.com
- spremenil: roli ()
Vredno ogleda ...
Tema | Ogledi | Zadnje sporočilo | |
---|---|---|---|
Tema | Ogledi | Zadnje sporočilo | |
» | Visual BasicOddelek: Programiranje | 3431 (2457) | cekr |
» | VB.net Excel v TifOddelek: Programiranje | 1145 (1044) | saule |
» | [VB2005Pro]Zapiranje in še Eno uprasanjeOddelek: Programiranje | 1135 (1068) | UltraTX |
» | [VB] Komunikacija s serijskimi napravamiOddelek: Programiranje | 2305 (1579) | mNeRo |
» | [VB] OpenOddelek: Programiranje | 1531 (1370) | Monster |