|
Use the /c parameter switch to cmd.exe thus:
pr.StandardInput.WriteLine("/c format G:" & Convert.ToCha(13)) txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Thanks for your reply, but I have still some doubt.
Could you explain that a little bit more?
Thnaks.
Gagan
|
|
|
|
|
Gagan.20 wrote: Thanks for your reply, but I have still some doubt.
Could you explain that a little bit more?
What more is there to explain? Open a command prompt window and type "cmd /?" for explanation of the switches and parameter options.txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
|
I have a doubt in the example you had suggested.
I am using a combo box to select drive name. In the code
Call SHFormatDrive(Me.hWnd, _
drvToFormat, _
SHFD_CAPACITY_DEFAULT, _
SHFD_FORMAT_QUICK)
where drvToFormat is declared as integer. When I am passing drive name to drvToFormat it is giving error that conversion from string to integer is not valid. What value should I paas as to drvToFormat to format my pen drive?
Thanks.
Gagan
|
|
|
|
|
You might want to read the documentation on SHFormatDrive[^]. You're passing in a string when you should be pass in a number. The number represents which drive to format. Read the documentation and you can figure out pretty easily, what that number is supposed to be.
|
|
|
|
|
Hi CP,
I am having a LineShape control with MouseDown,MouseUP,MouseMove events.
Dim fdragging As Boolean = False
Dim StartX, startY As Integer
Private Sub LineShape1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles LineShape1.MouseDown
fdragging = True
StartX = e.X
startY = e.Y
End Sub
Private Sub LineShape1_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles LineShape1.MouseMove
If fdragging Then
LineShape1.StartPoint = New Point(LineShape1.StartPoint.X + e.X - StartX, LineShape1.StartPoint.Y + e.Y - startY)
LineShape1.EndPoint = New Point(LineShape1.EndPoint.X + e.X - StartX, LineShape1.EndPoint.Y + e.Y - startY)
End If
End Sub
Private Sub LineShape1_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ShapeContainer1.MouseUp
fdragging = False
StartX = 0
startY = 0
End Sub
Now i am not able to move the lineshape control freely around the form with cursor like in the design time .
Cursor is changing the location so slipping happens .
How to stick the cursor to LineShape control.
Regards,For1206
|
|
|
|
|
|
Hi Dave ,
Already i am having selections , The problem is on mousemove the line control is moving but if the cursor goes out of the line control its not handling the mousemove i.e, Slipping of Cursor on the cursor . I tried to set the cursor location on the control but not working fine .
Regards,For1206
|
|
|
|
|
You didn't read the article. The problem you're concentrating on handling the mouse move in the LineControl's events. DON'T! The mouse is actually moving in the parent container of the LineControl. This is why your code doesn't work.
|
|
|
|
|
Hi Dave ,
Thanks for reply & Thanks for the Link ,Presently i am using ur code in my application for changing the line startpoint and endpoint and dragging the line also.
Can u suggest me in a sample program that how can i move a LineShape control freely around the form with cursor without slipping .
This is happening in a sample new form.
This is the code i used & its slipping from cursor .
Dim fdragging As Boolean = False
Dim StartX, startY As Integer
Private Sub LineShape1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles LineShape1.MouseDown
fdragging = True
StartX = e.X
startY = e.Y
End Sub
Private Sub LineShape1_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles LineShape1.MouseMove
Cursor.Current = Cursors.SizeAll
If fdragging Then
LineShape1.StartPoint = New Point(LineShape1.StartPoint.X + e.X - StartX, LineShape1.StartPoint.Y + e.Y - startY)
LineShape1.EndPoint = New Point(LineShape1.EndPoint.X + e.X - StartX, LineShape1.EndPoint.Y + e.Y - startY)
End If
End Sub
Private Sub LineShape1_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ShapeContainer1.MouseUp
fdragging = False
StartX = 0
startY = 0
End Sub
its important for me . plz can u suggest any work around ?
Regards,For1206
modified on Tuesday, February 23, 2010 1:57 AM
|
|
|
|
|
Read the article. I don't have time to write an entire sample app for you.
|
|
|
|
|
Hi Dave,
Thanks 4 reply . I already implemented your code in my application .Its made a nice job for me.
Thank you very much .
Regards,For1206
|
|
|
|
|
Hey All
I am having difficulty running a specific SQL statement in VB and was wondering if there is a way around it.
The problem I am having involves using "LIKE":
e.g. SELECT * FROM Table WHRE Field1 LIKE 'start*' (where start is the start of any text taken in as a parameter).
When I program an SQL statement like in VB, it won't yield the results I am looking for. I tested the code within SQL Server and MS Access Database and it works fine, but when I try again in the VB program, it yields no values.
The code does, however, work for "WHERE Field1 LIKE 'start'". So that means it has a problem with accepting the hash as part of the SQL query. I even tried using the VB character set within the SQL, but that too doesn't work.
Is there a way around this, or does VB not make use of the hash for an SQL statement?
Seems very weird to me.
Thanks for the help in advance!
|
|
|
|
|
Hi Evan
When using LIKE in SQL you should use the % character to indicate a wildcard character like this, SELECT * FROM Table WHERE Field1 LIKE 'Start%'. This works with Access databases as well as with MySql Databases, so should work with SQL Server.
Hope this helps
|
|
|
|
|
Hi
Thanks for the quick response...the '%' works perfectly.
Seems embarrassing for me to get stuck on such simple stuff when programming complicated systems sometimes.
Is there any reason why when using '*' works within each database but not when runnnig it through VB (or any other language) instead of '%'?
|
|
|
|
|
Because this is SQL syntax.
|
|
|
|
|
EvanSaunders wrote: SELECT * FROM Table WHRE Field1 LIKE 'start*'
Use % instead of *
SELECT * FROM Table WHRE Field1 LIKE 'start%'
|
|
|
|
|
|
VB does NOT use nor interpret any part of an SQL statement. All that state is to VB is just another String.
|
|
|
|
|
How to autodetect a CD/DVD in my CD/DVD Room?
|
|
|
|
|
Hello Cpianism ,
Every Operating System Have services for detection of Hardware the second form you can says they are drivers.
When you insert any device like (USB,CD,DVD) then the driver retrives notificaton.
Best Regard
AnubhavaIf you can think then I Can.
|
|
|
|
|
I need it by code. I need to write a program that copy the CD content once it detect it in the CD room. If you need anymore questions please do ask me.
|
|
|
|
|
|
Thanks, I will take a look at it now
|
|
|
|