| | |
A few little problems
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
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:
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:
(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:
There is also another type of XML i would like to read, but i have no idea HOW !:
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.
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:
VB.NET Syntax (Toggle Plain Text)
If e.KeyValue = Keys.Left Then Me.Left = Left - 25 If e.KeyValue = Keys.Up Then Me.Top = Top - 25
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:
VB.NET Syntax (Toggle Plain Text)
<grandma> <mother> <daughter> She has a little toy. </daughter> </mother> </grandma>
Any method would do, since i don't know too many... My only method of reading is this:
VB.NET Syntax (Toggle Plain Text)
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)
VB.NET Syntax (Toggle Plain Text)
<root> <example name="horse"> <this_animal_eats>grass</this_animal_eats> </example> <example name="wolf"> <this_animal_eats>meat</this_animal_eats> </example> </root>
Please help. Thank you very much.
•
•
Join Date: Dec 2002
Posts: 461
Reputation:
Solved Threads: 56
1. Me.WindowState = FormWindowState.Minimized 2.3. Dim strParms As String = "c:\Test.txt" System.Diagnostics.Process.Start(strParms) 4. Don't know someone can probably helpVB.NET Syntax (Toggle Plain Text)
'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
Wayne
![]() |
Similar Threads
- If i use an illegal copy of windows,will it cause problems? (Windows NT / 2000 / XP)
- Internet explorer problems (Web Browsers)
- Problems Downloading Windows XP (Windows NT / 2000 / XP)
- Connection Problems (Networking Hardware Configuration)
- Pop up ads (Web Browsers)
- No time... bitch load of problems (Windows NT / 2000 / XP)
Other Threads in the VB.NET Forum
- Previous Thread: Re: Basic Sorted Neighborhood in VB
- Next Thread: Open program when selecting default file
| Thread Tools | Search this Thread |
.net .net2008 2005 2008 access account advanced array basic beginner browser button buttons center client code combo cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic eclipse excel fade filter forms ftp generatetags gridview html images input insert intel internet listview map mobile monitor net number objects open panel passingparameters pdf picturebox picturebox2 port position print printing problem read remove save searchbox searchvb.net select serial settings shutdown soap socket sqlserver survey table temperature textbox timer timespan transparency trim txttoxmlconverter update user usercontol vb vb.net vb.netformclosing()eventpictureboxmessagebox vba vbnet visual visualbasic visualbasic.net visualstudio.net visualstudio2008 web winforms winsock wpf wrapingcode year





