Xcelled194 28 Junior Poster in Training

=> Three
what I meant is that if I wrote my code as a console application Can I easily change it to windows application by building the forms ??
and thanks a lot for your attention all

Yes you can. I wouldn't recommewnd it, as you'll need to tie your program logic into the form, which can be confusing if you've designed it around a console.

Xcelled194 28 Junior Poster in Training

Best solution would be to edit the App Manifest on Application TAb of the project properties. Set the requestedExececutionLevel to requireAdministrator

Xcelled194 28 Junior Poster in Training

Could you use Panels? If not, try creating your own custom control. You can set its shape with the Region property.

Xcelled194 28 Junior Poster in Training

I suggest you make your own thread for that instead of hijacking this one.

Xcelled194 28 Junior Poster in Training

OK, well, this is actually very simple. Here is my example, it is a console appication and it uses a const string of the song paired with a StringReader. However, it should be very easy to adapt it to use a StreamReader.

class Program
    {
        const string Song = @":beep frequency=660 length=100ms;
:delay 150ms;
:beep frequency=660 length=100ms;
:delay 300ms;
:beep frequency=660 length=100ms;
:delay 300ms;
:beep frequency=510 length=100ms;
:delay 100ms;
:beep frequency=660 length=100ms;
:delay 300ms;
:beep frequency=770 length=100ms;
:delay 550ms;
:beep frequency=380 length=100ms;
:delay 575ms;
:beep frequency=510 length=100ms;
:delay 450ms;
:beep frequency=380 length=100ms;
:delay 400ms;
:beep frequency=320 length=100ms;
:delay 500ms;
:beep frequency=440 length=100ms;
:delay 300ms;
:beep frequency=480 length=80ms;
:delay 330ms;
:beep frequency=450 length=100ms;
:delay 150ms;
:beep frequency=430 length=100ms;
:delay 300ms;
:beep frequency=380 length=100ms;
:delay 200ms;
:beep frequency=660 length=80ms;
:delay 200ms;
:beep frequency=760 length=50ms;
:delay 150ms;
:beep frequency=860 length=100ms;
:delay 300ms;
:beep frequency=700 length=80ms;
:delay 150ms;
:beep frequency=760 length=50ms;
:delay 350ms;
:beep frequency=660 length=80ms;
:delay 300ms;
:beep frequency=520 length=80ms;
:delay 150ms;
:beep frequency=580 length=80ms;
:delay 150ms;
:beep frequency=480 length=80ms;
:delay 500ms;
:beep frequency=510 length=100ms;
:delay 450ms;
:beep frequency=380 length=100ms;
:delay 400ms;
:beep frequency=320 length=100ms;
:delay 500ms;
:beep frequency=440 length=100ms;
:delay 300ms;
:beep frequency=480 length=80ms;
:delay 330ms;
:beep frequency=450 length=100ms;
:delay 150ms;
:beep frequency=430 length=100ms;
:delay 300ms;
:beep frequency=380 length=100ms;
:delay 200ms;
:beep frequency=660 length=80ms;
:delay 200ms;
:beep frequency=760 length=50ms;
:delay 150ms;
:beep frequency=860 length=100ms;
:delay 300ms;
:beep frequency=700 length=80ms;
:delay 150ms;
:beep frequency=760 length=50ms;
:delay 350ms;
:beep frequency=660 length=80ms;
:delay 300ms;
:beep frequency=520 length=80ms;
:delay 150ms;
:beep frequency=580 length=80ms;
:delay 150ms; …
Xcelled194 28 Junior Poster in Training

This sounds like a job for reflection. Unfortunately, my experience with reflection is limited, so I suggest googling "C# Reflection Method Name".

EDIT: quick google search, this looks exactly like what you want: http://en.csharp-online.net/CSharp_FAQ:_How_call_a_method_using_a_name_string

ddanbe commented: Excellent advice. +14
Xcelled194 28 Junior Poster in Training

Try surrounding your Foreach loop with a

Lock (dictionary) {

}
Xcelled194 28 Junior Poster in Training
double dValue = 0.0;

at line 21.

Xcelled194 28 Junior Poster in Training

If I understand you right, you want

MyPictureBox = this.picturebox1;
Xcelled194 28 Junior Poster in Training

Put this in the TextChanged event of the textbox.

If TextBox1.Text.Contains("-") Then
Msgbox ("Invalid!")
End If

Or if you need something Immediate, look into the KeyDown Event

Xcelled194 28 Junior Poster in Training

Correct me if I am wrong, but DocVeiwForm is a seperate form, no?

Sh why are you using Me.DocViewFrm.Show() ?

It should just be DocViewFrm.Show()

And you can open multiple forms with something like this (untested)

'This goes in your main form class
Dim WindowArray(0) as DocViewFrm

And then to actually show mutliple windows, you do this:

Redim Preserve WindowArray(Ubound(WindowArray)+1)
Dim M as long = ubound(WindowArray)
WindowArra(M) = new DocViewFrm
WindowArray(M).show
Xcelled194 28 Junior Poster in Training

Me.Close actually exits the program. Use Me.hide() instead.

Xcelled194 28 Junior Poster in Training

Its not a very elegant solution, but it should work for what you need.

Dim sTemp As String = "12             25.53            35"
        Try
            For I = 1 To sTemp.Length - 1
                If sTemp.Substring(I, 1) = " " Then
                    Dim SpaceCTR = 0
                    For L = I To sTemp.Length
                        If sTemp.Substring(L, 1) <> " " Then Exit For
                        SpaceCTR += 1
                    Next
                    If SpaceCTR > 1 Then
                        sTemp = sTemp.Remove(I, SpaceCTR - 1)
                    End If
                End If
            Next
        Catch ex As System.ArgumentOutOfRangeException
        End Try
Xcelled194 28 Junior Poster in Training
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim word As String
        word = TxtBox1.Text.ToLower
        For I = 0 To word.Length - 1
            If word.Substring(I, 1) = word.Substring(word.Length - I - 1, 1) Then
                Continue For
            Else
                TxtBox1.Text = "The word is not a palindrome." : Exit Sub
            End If
        Next
        TxtBox1.Text = "The word is a palindrome."
    End Sub
Xcelled194 28 Junior Poster in Training

You Might look into using regular expressions or the Like operator:

If phonenumbertxtbox.Text Like "$$$-$$$-$$$$" Then Msgbox ("Correct")

Regular expressions are more advanced, but you can do more checking with them.

Xcelled194 28 Junior Poster in Training

So you want to raise the Picturebox1.Click event when the user presses the enter key?

Why not make a hidden button, make it your "accept button" and then use the following code

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        PictureBox1_Click(sender, e)
    End Sub
Xcelled194 28 Junior Poster in Training

So wait. When the use presses the Enter key, what do you want to have happen?

Xcelled194 28 Junior Poster in Training

There are several problems with your code. I've corrected them in the following:

Public Class frmAssign6
    Dim sr As IO.StreamReader = IO.File.OpenText("words.txt")
    Private Sub btnProcess_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnProcess.Click
        Dim words1 As String = "" 'Always initialize it, just to be safe

        While Not (sr.EndOfStream)
            words1 = sr.ReadLine
            lstResults.Items.Add(words1) 'This needs to be inside the loop, or you just add the last line of the file
        End While

        sr.Close() 'Always close a file when you are done reading it
    End Sub
End Class

1. You should always give things an initial value, just to be safe (Especially if the text document may be empty. Check your words.txt and make sure there is stuff in it)

2. Your lstResults.Items.Add(words1) line should be inside the while loop. Otherwise, it loops through the file and adds only the last line.

3. Its always a good idea to close a file after you're done with it.