I have purchased Visual Studio .Net 2003 and i like it, it's quite easy yo use, but i have a few problems i cannot solve.
Im assume that some of the problems are solved somewhere in here, but i am in an internet cafe, i dont have an internet connection home so i dont have the time to search through the forum... :-s

1: If i make a button to CLOSE the application i just have to type "END" into the [private sub button_click... / end sub], but what if i want to make a button to minimize the window ? (I hope it's just a short word, like "END").
I tried Me.Close (that works like END) and Me.Hide... but "hide" really hides the window and i must stop debugging and restart the application to maximize it again. :p I'm sure it's very simple.

2: How can i make one form move if i drag it, wherever i would click on it? I mean, i can move a window only if i grab the bar (the thing with minimize, maximize and close buttons). But HOW can i move the window by clicking and draging anywhere on it ?
I tried something with Ctrl+arrows to move the window and it works:

If e.KeyValue = Keys.Left Then Me.Left = Left - 25
If e.KeyValue = Keys.Up Then Me.Top = Top - 25

But how can i do something similar with the mouse? I tried to make Private Sub Form1_DragDrop and the only thing it had to do was to MsgBox("You drag-dropped the form"), but whatever i do, i dont see the msgbox, so i'm doing something wrong.

3: How can i launch one .mp3, or .avi, or .doc from my application ? I dont want to make a video player or a MS Word clone. I just want the file to open with media player (for mp3), or word (for doc).
I really need the most efficient way, to open the files very fast.

4: I've learned one method to read XML files... but how can i WRITE some data into a XML file ? Lets suppose i have:

<grandma>
	<mother>
	<daughter> She has a little toy. </daughter>
	</mother>
</grandma>

(Lol, this is the first example that popped up in my mind.) I want to read "She has a little toy." and write "She has a BEAR." instead.
Any method would do, since i don't know too many... My only method of reading is this:

Dim ShownTEXT as String
Dim Doc As New XmlDocument
Dim Nav As XPath.XPathNavigator
Dim Iterator As XPath.XPathNodeIterator

	Doc.Load("..\Data.xml")
	Nav = CType(Doc, XPath.IXPathNavigable).CreateNavigator()
	Iterator = Nav.Select("grandma/mother/daughter")
	Iterator.MoveNext()
	shownTEXT = Iterator.Current.Value
	MsgBox(shownTEXT)

There is also another type of XML i would like to read, but i have no idea HOW !:

<root>
	<example name="horse">
		<this_animal_eats>grass</this_animal_eats>
	</example>
	<example name="wolf">
		<this_animal_eats>meat</this_animal_eats>
	</example>
</root>

How can i read what example named "Wolf" eats, instead of reading what "Horse" eats ? Then, how can i write anything else instead of "grass" and "meat" ?

Please help. Thank you very much.

Me.WindowState = FormWindowState.Minimized

This is not my code. It is It is copyrighted by Andrew Vos 2004 :) to whom I am gratefull.

Private Sub PlaceHolder_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
        MouseDragging(e, Me)
 End Sub
 Public Sub MouseDragging(ByVal e As MouseEventArgs, ByVal Control As Control)
        Static OldPosition As New Point(-1, -1)
        If Not (e.Button = Nothing) Then
            If e.Button = Windows.Forms.MouseButtons.Left Then
                If (OldPosition.X = -1) And (OldPosition.Y = -1) Then OldPosition = New Point(e.X, e.Y)
                If e.Y <> OldPosition.Y Then
                    Control.Top += e.Y - OldPosition.Y
                End If
                If e.X <> OldPosition.X Then
                    Control.Left += e.X - OldPosition.X
                End If
            End If
        Else
            'button is nothing, maybe it was lifted.
            OldPosition = New Point(-1, -1)
        End If
    End Sub

    Private Sub PictureBox1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove
        MouseDragging(e, Me)
    End Sub

Dim strParms As String = "c:\Test.txt"
System.Diagnostics.Process.Start(strParms)

Don't know someone can probably help

Wayne

Thank you very much for all the help, everything is going great.
As for the last problem i had, i am using NINI. (nini.sourceforge.net)

Thanx again.
Everything is solved. :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.