Close A Usb Port?

Feb 8, 2011

How can one close the usb port (shut off power (electric current)) ?

View 8 Replies


ADVERTISEMENT

Cant Close Form With Serial Port Open?

Jul 8, 2008

I have a programme that accepts data from a serial port. If I close the port and then the form no problem. However if I try to close the form with out closing the port it appears to hang. I have tried closing the port in the forms close event but this did not solve the problem.The data recieved event is as below and UseData is the private sub which actually handles the data. Usedata contains the code line Dim InputText As String = SerialPort1.ReadLine
Private Sub SerialPort1_DataReceived(ByVal sender As System.Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived

Me.Invoke(New myDelegate(AddressOf UseData), New Object() {})

End SubI am aware that this event runs on another thread and I have seen but cannot now find information about closing multiple active threads.or do I have to "uninvoke" the delegate

View 1 Replies

Close Serial Port After Data Received?

Feb 22, 2009

I have the following code that listens to a serial port and writes the incoming data to a listview control (the serial data are a delimited string taht arrives once per second that I parse into separate listview subitems). I would like to be able to close/disconnect the serial port once a specific value in the incoming string is detected. For example, in this case one of the columns of data in the incoming string represents depth, I would like to close the serial port when the depth falls below a given number. I have tried the code below, but my program crashes on the SerialPort.CLose method.

dim m_strOBS() as string
Private Sub SerialPort_OBS_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) _

[code].....

View 4 Replies

Communications :: Close Serial Port After USB Device Unplugged?

Oct 1, 2009

There seems to be a lot of discussion around about handling exeptions when a USB serial port device gets unplugged. What I want to know is how can one re-attach to it once it is plugged back in. The problem is that if you unplug a USB serial port device the app doesn't know it has gone and remains convinced it is still open. I have to close the app completely before I can re-attach to the device. I need a way to force it to close/go away.

View 2 Replies

Simple Code In Vb To Open / Close USB Port (Windows 7)?

Jun 11, 2011

I need to simple code in Vb.Net for Open / close USB Port (Windows 7) ...

View 7 Replies

Unable To Close Serial Port After USB / Serial Converter Disconnected

Mar 28, 2006

I have a stand alone VB.Net 2005 application that uses a serial port that generally stays open while the application runs on a Windows XP system. In trying to bullet-proof the UI, I ran into a problem when the USB to Serial Converter normally used to provide the serial port is disconnected while the serial port is open. In trying to handle the resulting error when accessing the port, I find I cannot close the port.

When trying to do so, the error message says something like "unable to close the port. You may not have sufficient permissions." Reconnecting the USB/Serial Converter does not reactivate the port.

[Code]...

View 8 Replies

RTF Close - Add A Close Button To Menu Strip That Will Just Close The Currently Opened File

Jan 16, 2009

I'm currently in the process of building a text editor type program, and have run into a brick wall. I haven't done VB in years, so I may just need a little reminder on some things. I have coded everything so far as far as opening files, saving them, changing fonts, colors, etc. However, I'm looking to add a Close button to my menu strip that will just close the currently opened file, and not the entire program, while also ask the user if he/she would like to save before closing the file, and then if they select yes, it will show the save dialog, and if not, it will go ahead and close the currently opened item.

View 2 Replies

Read The Data From Barcode Weight Scales By Serial Port And TcpIp Port?

Nov 27, 2010

I'm mohammed from Oman ,I'm visual studio.net programmer How I can Read the Data From Barcode Weight scales By Serial port and TcpIp port

View 7 Replies

Get FullName From Available Serial Port (Com Port) From Device Manager In Windows Form With .net?

Jul 25, 2011

I have a Windows form.in windows form have a combo box that give me a list of available port serial with it code (Dim ports As String() =SerialPort.GetPortNames())for example( Com1,Com8,Com15,...).but I want to give me fullname of serial port in device manager for example in dvice manager is these (Comunication Port(COM1) - Printer Port(LPT1) And USB Serial Port(COM8)).how to Get it?

View 2 Replies

Detect The Address And Port Number Of The Parallel Port In Computer?

Jun 9, 2010

I would like to detect the Address and Port number of the Parallel Port in computer.

View 4 Replies

The Given Port Name Does Not Start With COM/com Or Does Not Resolve To A Valid Serial Port?

Aug 2, 2011

If I uninstall the COM1 and reboot, it works. If I shut down (power off) and restart, I get the message below. If I uninstall then click on Scan for Hardware Changes,The given port name does not start with COM/com or does not resolve to a valid serial port. Parameter name:portName

View 8 Replies

Communications :: .net MSComm Port USB 4 Port Relay?

Oct 20, 2011

I am trying to get my 4 port USB relay board to work in VB.net using the COM PORT. I found some code from a poster who has the 16 port USB relay version. When trying his code i can only get it to turn on relays 1-3 all at the same time. The product can be found here: USB 4 port relay

"01+//" - Relay 1 is switched ON
"01-//" - Relay 1 is switched OFF
"02+//" - Relay 2 is switched ON
"02-//" - Relay 2 is switched OFF

[code].....

So i am confused as to how to separate each relay out with that code above and just be able to turn on any number 1-4 relay on or off independently from each other!

View 1 Replies

[2008] Notify Icon When The User Clicks The Close Button That It Doesn't Close The Form?

Jan 17, 2009

I have set up a notify icon for my form. I want to make it so that when the user clicks the close button that it doesn't close the form it just takes it to shows the notify icon. They can exit the program from the notify icon. Can someone tell me how to keep it running?

View 2 Replies

Click My Close Button The Application Will Close But The Debugger Is Still In Active?

Nov 29, 2009

It seems like whenever i click my close button the application will close but the debugger is still in active.How to exit this debugger? :)

View 2 Replies

Close() Puts Forms Into Crazy Open/Close Loop?

Mar 4, 2011

In a program I'm working on, I want a "Loading..." dialog to close when it can't log in to a site using the username and password provided by the user. Basically, I have the code set up right because the function it is supposed to carry out when that occurs does work, but for some reason it ends up in some really weird stuff happening. In the Loading form, I have it set to do "Form1.Show()" and then "Me.Close()", assuming it would simply show the login form and then close the Loading form. However, when this happens, the Loading form closes, and then for only an instant Form1 shows, and then the Loading form shows and Form1 closes. This happens forever until I stop the debugging, and I can't seem to figure out why. Am I using the wrong method? What exactly does Me.Close() do anyways? All I want to do is close the form and open another

View 5 Replies

Error : Private Function Close() As Integer Implements IVsPersistDocData.Close Has Multiple Definitions With Identical Signatures?

May 12, 2010

I have two Close() functions in same class as below:

[Code]...

View 2 Replies

.NET End Vs Form.Close() Vs Application.Exit Cleaner Way To Close One's App?

Feb 12, 2011

sometimes, when I use Form.close() when debugging my program, although the form is closed, the application is still running. I noticed this behaviour when using the msgbox function.

View 3 Replies

Close Windows Calculator In .net 2008 When Application Close?

Aug 30, 2009

how to use windows calculator in vb.net 2008?

use System.Diagnostic.Process.Start(calc)

its working but i want when application close it also close this calculator how?

View 3 Replies

VS 2008 When Close The Main Form All The Forms Close?

Aug 30, 2009

my web browser is my main form and it has a number of sub forms , how can i set it that when i close the main form my sub forms dont close ?

At the moment when i close the main form all the forms close

View 2 Replies

MSComm Port USB 4 Port Relay

Oct 20, 2011

I am trying to get my 4 port USB relay board to work in VB.net using the COM PORT. I found some code from a poster who has the 16 port USB relay version. When trying his code i can only get it to turn on relays 1-3 all at the same time. The product can be found here: USB 4 port relay I was following what the guy in the post was doing to turn his on:

[Code]...

View 6 Replies

Forms :: When Me.close() Doesn't Close Form

Mar 2, 2009

I have a situation where me.close() doesn't close the form. I have a form with a button with the code seen below. What happens when the button is clicked is the new form shows, but the original form(calling form) is still there. When I go into debug mode, I can see the me.close() execute, but nothing happens (calling form stays open). When I close the second form both forms close. If I comment out the call for the second form to open the first form closes without problem.

Private Sub cmdNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdNext.Click
Dim f As New frmOrder3

[Code].....

View 1 Replies

Communications :: Serial Port - Run Program, "Access To The Port 'COM1' Is Denied"?

Oct 15, 2008

Im having problem with the Serial Port. When i run my program, "Access to the port 'COM1' is denied". What does that mean? Im not sure whats happening because theres no error in my code. Someone suggest me to use 'COM2'. Which is also the same result. I have a microcontroller, programmed and run it. And i need to capture the data onto my vb, which is on a multiline textbox. How to i do that?Just to double check my code?

[code]...

View 1 Replies

How To Close One Form In A Project And Note The Entire Project When Using Me.close() In Visual Studio 2008

Mar 22, 2010

I am really new to Visual Studio and VB and I am having trouble closing a single form:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Me.Close()
End Sub

When I use Me.close() associated with this button it closes the entire project and not just the single form can anyone.

View 2 Replies

Reading Serial Port Read Data From Serial Port?

Aug 16, 2011

i am a absolute beginner and i want to use vb to receive data from micro controller through serial port using rs232 standards, i found this code to receive the data serially, can any one tell me where should i paste this code, so that the data received will be displayed in message box.Private Sub DataReceived(ByVal sender As System.Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) HandlesSerialPort1.DataReceived

[Code]...

View 9 Replies

Serial Port Example Code - Connect To A Modem Thru The Serial Port

Oct 26, 2011

The link below has code to connect to a modem thru the serial port but it is for an earlier version of VB. when I convert the code, it does not fully convert and has 4 errors that prevent building the project. can someone tell me what needs to be changed or added?

[URL]

Note: the error: not CLS-Compliant

View 8 Replies

VS 2008 : Modal Form Hide Instead Of Close - Main Form Does Not Close

Mar 20, 2009

I have a main form that has a button with which a smaller form is shown. Think of the smaller form as the Find/Replace dialog in many applications, such as Notepad. It's important that the form is (what I believe is called) modal. What I mean is that it always stays on top of the main form. I ensure that by calling the Show method with "Me" as the owner argument. Whenever the small form loses focus it will not disappear into the background but stay visible (albeit out of focus). If you don't understand open up Notepad and have a look at the behavior of the Find/Replace dialog.

Here's my problem: instead of actually closing the form when the X is pressed, I want it to simply Hide itself, so its position and the state of any controls (checkboxes etc) is preserved automatically.To achieve this I simply cancel the FormClosing event and Hide it:

vb.net
Private Sub Form2_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing

[code]....

To show the form, I use the following (note the (Me) to make the main form the owner of the form; this ensures that it remains visible even when it is out of focus):

vb.net
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Form2.Show(Me)
End Sub

Now. When I run my project, and open the Form2 (small form), then hide it again (by 'closing' it), I can no longer close the main form (Form1)! It seems the main form cannot close when the small form still exists (albeit invisible)...?? When I don't use the Me argument in the Show method, I don't get the behavior I want. I know I can set the TopMost property to True but that will also cause it to become visible on top of all the other forms, even windows not part of my application.

View 8 Replies

Get USB Control For The USB Port Communication? Like The SerialPort Control For The COM Port

Jul 17, 2009

Do someone know if there is a\\ USB control for the USB port communication? like the SerialPort control for the COM port.

View 2 Replies

Using Me.close() To Close A Project

Nov 18, 2009

i am using me.close() to close a project in vb.net. but by using project is not closing properly. is there any another method to do this?

View 2 Replies

.net - Enter Key Should Save And Close And Escape Key Should Close Without Save

Dec 11, 2009

In vb dot net, Windows form details should save if I press enter key should save and close and escape key should close without save

Currently it happens on onclick event of a button of Save and Cancel, but I wish the keyboard events also work

View 1 Replies

Me.Close() Doesn't Work - The Form Doesn't Close?

Apr 16, 2009

The form is an About Us form so has nothing on it only a text box and a OK button.

[Code]...

Why won't the button close the form? I'm puzzled, I tried another button just in case with the same result. UPDATE: I set a break point on Me.Close() and it isn't reaching it when I click the button, I created a new button and the same thing happened.

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved