|
Thanks, but ...
The parallel port is already in use.
The only thing i have to do is after pressing a button on the screen send a single pulse to the serial port for opening a lock. I have a opto coupler for saftey, so a single flash from the led is all it takes.
|
|
|
|
|
The problem with that is the pulse comming from the serial port usually isn't long enough to allow an LED to completely illuminate.
You can TRY this (lifted from Experts Exchange):
MSComm1.CommPort = 1 'select your com port either 1 or 2 or 3 if you have it
MSComm1.Settings = "9600,n,8,1" 'this must be configured to your specifications
'9600 is the baud rate, n is no parity bits, 8 data bits and 1 stop bit
MSComm1.PortOpen = True 'opens the port
End Sub
'To send data from the com port
Private Sub cmdSend_Click()
MSComm1.Output = "111111111111111"
End Sub
It uses the old MSCOMM control from the VB6 days. There's virtually no examples of doing this, because of the problems with using the serial port to do anything useful with an LED.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
You could use a microcontroller and send data via the rs232 port!
I don’t know your electronics abilities, but a simple PIC16F84 or PIC16F628 would be suitable, you can even use BASIC to program the PIC. Just create a basic selection program and control it via VB.NET.
Trust me there are thousands of examples on the net!
|
|
|
|
|
Hello,
I am coding a text editor program. I creat my main form with a menu. While the user hit a menu item, a different form would come out and ask for input. After that, I would like the change reflected in the main form, say, TextBox1 in the main form.
Can somebody give suggestions?
Best,
Hui
|
|
|
|
|
Different way of accomplishing it.
Common one, and easiest, is:
sub form1clickwhattever....
form2.show
me.textbox1.text = form2.controlwithdata.text
end sub
|
|
|
|
|
Thanks for the reply. I tried to use the code in my program. However, it does not work. I would like the me.textbox1.text get changed after the user click on an OK button in the 2nd form. The code above replaces the textbox1.text with a blank string, since the user has not filled out the info yet. I guess that I need to refer to the caller (main form) in the called form (child form), but I don't know how to refer to the main form in the child form. In Visual Basic 6, I think I can just call its name but not in Visual Basic .Net. Any suggestions?
|
|
|
|
|
Well my code has an error or better it was missing the form2.showdialog (so that the next line is executed only after the form2 has been hidden/closed with the button).
So if you replace .show with .showdialog then it works.
Anyway if you want a more precise answer you should provide more precise informations. Which versione of FW are you using 1.x or 2? VS2003 or VS2005.
In VS2003 you can refer to the calling form only if it's public declared.
Module x
public fmain as new frmMain
end module
then in the form2 button click event handler:
fmain.textbox1.text = ....
In VS2005 in most cases you can state immediatly the form without instancing it. This means you can have a direct access to frmMain (considering the previous example) unless you're running an instance created by you (than you fallback in the former case).
Another way of doing it is by raising an event.
In form2 you'll have:
...
raisevevent OKClicked()
and in form1
private sub ClickOnForm2() handles frm2.OKClicked
me.textbox1.text = frm2.textbox1.text
end sub
or using parameters ...
public class frm2eventargs
inherits eventargs
public t as string
end class
on form2 before you raise the event...
dim e as new frm2eventargs
e.t = (text to pass)
raiseevent OKClicked(me,e)
and then on the mainform
private sub frm2OKClick(sender as object,e as frm2eventargs) handles frm2.OKClicked
me.textbox1.text = t
end sub
So as you can see lot of options depending on the approach you want and what you're using.
|
|
|
|
|
At a other site on the web (http://www.codeguru.com/columns/VB/article.php/c6529[^]) I found a sample for TypeConverters. I played a little with this sample: I added a new class 'TestControl' (Inherited from UserControl) with one userdefinded-Property 'TestProperty As Circle'. If I add my TestControl to a Form, the IDE generates the following Code:
Me.TestControl1.TestProperty = CType(resources.GetObject("TestControl1.TestProperty"), tester.Circle)
And now there comes my problem: I want that the TestProperty becomes a ReadOnly-Property and die generated Code has to look like this:
Me.TestControl1.TestProperty.X = 4<br />
Me.TestControl1.TestProperty.Y = 5<br />
Me.TestControl1.TestProperty.Radius = 3
Is this posible or want I too much?
|
|
|
|
|
|
The second time you helped me much. Thanks
|
|
|
|
|
Your welcome (for both times of course )!
Pompiedompiedom...
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
|
|
|
|
|
Is there simple way to find out how many records there are in a database table? Access database table that is.
|
|
|
|
|
The only way with Access I knowing is the following SQL-Statement:
SELECT COUNT(*) AS TableCount FROM [Table]
|
|
|
|
|
Hi
I am trying to draw a rectangle over an existing image by using the following code (pb is the PictureBox and has an image)
<br />
Dim oGraphics As Graphics = Graphics.FromImage(pb.Image)<br />
With oGraphics<br />
.DrawRectangle(New Pen(Color.Red, 2), New Rectangle(5, 5, 300, 300))<br />
End With<br />
pb.Refresh()<br />
The problem comes when I want to draw another rectangle (at a different location) and I can't remove/clear the existing rectangle before drawing the new one.
Is there any way I can remove the existing drawn rectangle?
I don't want to use the pb.CreateGraphics() b/c the drawing is not consistent when this method is used.
I am using the FromImage() method b/c later I want to resize (zoom) or rotate the image with drawn rectangle and It won't require any further coding for rotating and resizing the rectangle.
I tried reload the Image again, but large images take to much time to load, so I want to avoid the Image reloading.
Please help!
|
|
|
|
|
Maybe you can load the image, and the clone it, and the put the clone in the pb? That way, when you want to remove the stuff you were drawing on the image of the pb, you can dispose that image and put a new clone of the original in the pb. I think on large images cloning takes much time too, but less that reloading it.
Pompiedompiedom...
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
|
|
|
|
|
I haven't worked with graphics for a while, so I don't know how hard this would be, but could you lay down the image first, and then overlay a transparent picturebox on the first image? Then, instead of drawing the rectange directly on the image, you can draw it over the image, on the second picturebox.
Roy.
|
|
|
|
|
Thank You Roy,
I am not sure and don't remember it correctly (I read it somewhere) that there is something like a Xor Pen.
Is there anything like this that can help me?
Another CP user in the C# forum suggested me that I should remember the Pixel values of the image (for rectangular area) before drawing the rectangle. How do I remember those values and how to reload those values?
|
|
|
|
|
Hello, how can i make a chat messanger using the ips! i want to send a message from a computer to another computer in another house not in my house! I want the program to send a message to another pc using ips! Thanks alot!!
Adrian De Battista
|
|
|
|
|
Try looking at the TcpClient, TcpListener and NetworkStream classes in the System.Net namespace.
|
|
|
|
|
As the subject suggest how can i monitor CPU.
|
|
|
|
|
Maybe this[^] is what you're looking for?
Pompiedompiedom...
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
|
|
|
|
|
Hi All ,
how can i receive the ip address from a remote client?
im using this code to listen to a client:
dim PORT as integer = 10000
listener = New Sockets.TcpListener(System.Net.IPAddress.Any, PORT)
listener.Start()
Dim client As TcpClient = listener.AcceptTcpClient()
now i need the client ip address ?....
|
|
|
|
|
hey all,
Does anyone know, how to determine the port of a printer? I need this to know because my application allows a user to select a printer but all print jobs are send directly to the port (i.E. "copy print.txt LPT1").
I do not find any information abount this
I'm using VB.NET 1.1
thx, bernd
|
|
|
|
|
The GetPrinter API can be used from VB.Net to get this info.
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|