Click here to Skip to main content
15,891,801 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: How to detect what serial port is used when an arduino is plugged in and how to use this serial port data to control maglocks Pin
Chris Quinn29-Dec-16 20:39
Chris Quinn29-Dec-16 20:39 
AnswerRe: How to detect what serial port is used when an arduino is plugged in and how to use this serial port data to control maglocks Pin
Ralf Meier31-Dec-16 1:22
mveRalf Meier31-Dec-16 1:22 
QuestionProblem Setting OpenFileDialog.InitialDirectory Pin
Alan Burkhart29-Dec-16 4:52
Alan Burkhart29-Dec-16 4:52 
GeneralRe: Problem Setting OpenFileDialog.InitialDirectory Pin
Richard MacCutchan29-Dec-16 5:43
mveRichard MacCutchan29-Dec-16 5:43 
GeneralRe: Problem Setting OpenFileDialog.InitialDirectory Pin
Alan Burkhart29-Dec-16 6:11
Alan Burkhart29-Dec-16 6:11 
AnswerRe: Problem Setting OpenFileDialog.InitialDirectory Pin
Ralf Meier31-Dec-16 1:29
mveRalf Meier31-Dec-16 1:29 
GeneralRe: Problem Setting OpenFileDialog.InitialDirectory Pin
Alan Burkhart31-Dec-16 5:16
Alan Burkhart31-Dec-16 5:16 
GeneralRe: Problem Setting OpenFileDialog.InitialDirectory Pin
Member 128864681-Mar-18 22:07
Member 128864681-Mar-18 22:07 
I struggled with the same problem. When I set the AutoUpgradeEnabled to True, it started working better. But I added the below code and it seems to always works now.

VB
Public Class frmSample

    	Dim openFileDialog1 As New OpenFileDialog()

    	Dim sTemp As String

        Private Sub btnOpen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)       Handles btnOpen.Click

        	openFileDialog1.AutoUpgradeEnabled = True

        	sTemp = "None"
        	sTemp = OpenDir()
        	Do Until sTemp <> "None"
            		'Nothing
        	Loop
		'The above loop is my solution.
		'It makes sure that the initial directory is known, before 
                'continuing to If OpenFileDialog1.ShowDialog

        	openFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*"
        	openFileDialog1.FilterIndex = 0
        	openFileDialog1.RestoreDirectory = True

        	If openFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then

            		'Enter your code

        	End If

    	End Sub

        Private Function OpenDir() As String

        	openFileDialog1.InitialDirectory = "C:\Sample Initial Directory"
        	Return "OpenDir"

    	End Function

End Class

GeneralRe: Problem Setting OpenFileDialog.InitialDirectory Pin
Alan Burkhart2-Mar-18 6:12
Alan Burkhart2-Mar-18 6:12 
QuestionHow to read listview data in to a report Pin
RedRocket201621-Dec-16 8:59
RedRocket201621-Dec-16 8:59 
AnswerRe: How to read listview data in to a report Pin
Eddy Vluggen23-Dec-16 2:50
professionalEddy Vluggen23-Dec-16 2:50 
Questionreload listview of parent form from user control vb.net Pin
l3ugs.l3unny18-Dec-16 17:57
l3ugs.l3unny18-Dec-16 17:57 
AnswerRe: reload listview of parent form from user control vb.net Pin
Dave Kreskowiak19-Dec-16 6:47
mveDave Kreskowiak19-Dec-16 6:47 
QuestionMy demo reports program gives error[SOLVED] Pin
tacbanon18-Dec-16 15:41
tacbanon18-Dec-16 15:41 
QuestionHow to View two different report (Crystal Report) in one view ? Pin
Hermawan2615-Dec-16 19:40
Hermawan2615-Dec-16 19:40 
AnswerRe: How to View two different report (Crystal Report) in one view ? Pin
Afzaal Ahmad Zeeshan15-Dec-16 23:13
professionalAfzaal Ahmad Zeeshan15-Dec-16 23:13 
GeneralRe: How to View two different report (Crystal Report) in one view ? Pin
Hermawan2616-Dec-16 16:06
Hermawan2616-Dec-16 16:06 
QuestionNative Compiler for VB Pin
rkinning13-Dec-16 15:39
rkinning13-Dec-16 15:39 
AnswerRe: Native Compiler for VB Pin
Dave Kreskowiak13-Dec-16 17:39
mveDave Kreskowiak13-Dec-16 17:39 
GeneralRe: Native Compiler for VB Pin
rkinning14-Dec-16 5:40
rkinning14-Dec-16 5:40 
GeneralRe: Native Compiler for VB Pin
Dave Kreskowiak14-Dec-16 6:55
mveDave Kreskowiak14-Dec-16 6:55 
AnswerRe: Native Compiler for VB Pin
Eddy Vluggen14-Dec-16 6:19
professionalEddy Vluggen14-Dec-16 6:19 
JokeRe: Native Compiler for VB Pin
Richard Deeming14-Dec-16 7:27
mveRichard Deeming14-Dec-16 7:27 
AnswerRe: Native Compiler for VB Pin
Gerry Schmitz14-Dec-16 12:34
mveGerry Schmitz14-Dec-16 12:34 
QuestionSubreportProcessingEventArgs, getting the type to complete a CType for a DataSet in a report writer Pin
jkirkerx13-Dec-16 9:11
professionaljkirkerx13-Dec-16 9:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.