|
Take a look at that[^]
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
hi all,
i am creating a numberbox control and in that i want to find the cursor position so that i can restrict input at certain times at certain locations ...
.
so is thr any way i could get the cursor location or the index of the key pressed.
Thanks in advance
|
|
|
|
|
is it WinForm or WPF?
both at very very different way to look at that problem!
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
hi ,
sorry for late reply ..
its a web form in .net 2.0
thanks and regards,
sriharsha
|
|
|
|
|
Hello
I am having a datagridview with columns
Existing balance
Credit
Debit
and one button save.If i Click on the save button the value i entered in
the credit or debit column must get into the column existing balance.
Plz help me....
|
|
|
|
|
Is it the bound DataGridView? If yes, then set the Expression property of the Balance column(in the datatable) to sum of credit and debit.
If not, then loop through all the rows and set the value in the balance column's cell in the button click event.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Hi.
i want to display an gif image in picturebox cuncurrent with for().below is my code,but image dont load while for() is running.
please help me.thanks.
private void button1_Click(object sender, EventArgs e)
{
PictureBox pic = new PictureBox();
pic.Image = Image.FromFile("c:\\1.gif");
this.Controls.Add(pic);
for (int i = 0; i < int.MaxValue; i++)
{
}
pic.Dispose();
}
|
|
|
|
|
try
Application.DoEvents();
just before for iteration
|
|
|
|
|
Add pic.Refresh(); after you add the control.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
msrezapro wrote: pic.Dispose();
what is this? pic is a control you added to this.Controls, you can't just call Dispose() on it as it is still in use. And you should dispose of images you no longer use. Hence, if you want to remove the image, do:
pic.Image.Dispose();
pic.Image=null;
if you want to remove the picturebox, do:
this.Controls.Remove(pic);
possibly followed by the former code.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hy again. I have a new question: I want a string to see it flashing when I click a button. It sound crazy but I actually want to adapt it to a led connected to serial port (rs232) (pin3+/pin5gnd) and to make it like a strobe light (at a fv of 100ms for example). But first I want to make a test with that string (if you happen not to be interested about serialPorts)
Thanks
private void btnTEST_Click(object sender, EventArgs e)
{
for (int i = 0; i < 10; i++)
{
label1.Text = "a";
}
}
|
|
|
|
|
I wouldn't recommend it - you may damage the serial port, and find it difficult to control the LED - use pin 7 (RTS) or pin 4 (DTR) instead as these are intended to to steady levels, rather than data. I would sugest a resister for current limit may be an idea - check the electrical spec of the serail port - off the top of my head it's V28 - as I haven't played with this for years.
For text flashing , set up a timer, then alternate "a" and "" into the label.Text property. 100ms by be too quick to see nicely though.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
I use "SerialPort3.BreakState", to manage making a flashing led. On pin 4 or 7 the this property is not good at all(I have done the test right now).
|
|
|
|
|
how to activate the pin 4 or 7 from rs232, to be able to use the properties and methods from SerialPort control?
|
|
|
|
|
here is the pin explanation and from what I see the 4&7 have
RTS & DTR are binary outputs that can be manually set and held
4 DTR (Data Terminal Ready) Output
7 RTS (Request To Send) Output
http://www.aggsoft.com/rs232-pinout-cable/images/9-pinout.gif
how can I manually set those outputs?
.
modified on Thursday, August 6, 2009 6:51 AM
|
|
|
|
|
if you want to use a class, read its documentation. So go read about SerialPort class. It is all available in MSDN.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
See SerialPort.RTSEnable and SerialPort.DTREnable
MSDN SerialPort[^]
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
thank you v much. Now indeed is blinking on pin 7 with command property RtsEnable. very nice.
But now I want to make a matrix of LEDs, dancing.
What I should use? a Demultiplexer CI? I have a 74159 Demultiplexer.In theory it should work + a ULN 2003. It is a easy another way? I need advice.
The Idea is like this: How can I ramify the number of pins to send data to (let's say 80 led's, or 15 steppers(5wire)) a lot of pins and the fv at that I can send the bit information not to be minimize dramatically?
thanks.
|
|
|
|
|
Glad to hear it works!
I'm not a hardware engineer - but I have worked with H/W designers for long enough to have a good idea what they are talking about, so here goes:
Running a large number of LEDs is going to be a problem. Several in fact:
1) Each LED consumes power, and the serial port is not going to give you too much of that! That is one of the reasons USB was designed - it provides 500mA, loads more than RS232. You will need external power very soon, or you will risk damaging your PC. Each LED consumes from 20mA on up, so just 25 is the limit for USB!
2) A 74159 is not realy going to work: it uses four inputs to drive one of 16 outputs. If you want to drive lots of outputs, why not look at putting a PIC or similar in there, and interfacing it to the serial port as a serial port? You can then provide the external power from a main adapter or battery, and do what you like with the LEDs. You would also get an introduction to the wonderful world of microcontrollers! And probably, assembler, though C is available for PICs. It is a lot more flexible that way!
3) You would need to look at MAX232 or similar chip to do the +12/-12V RS232 to +5V logic of ICs whatever you use, or the ICs are all going to die very quickly...
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
yes the plan is like you said .
I have already a PIC18F4550 PDIP and I intend to program it (maybe some insights on what testing board I should use? the best that there is ) and the cheap one + the ability of programming with it the older pic 16f84 that I have in stock also;but not necessary.
But my concern is after I program the pic (the18f one) and I have 40 inputs to fill in from the Led matrix, + the external source (an atx will suffice) how I can fill the gap between pic and those 40 inputs? I need something that I can use to fulfill the 40 outputs, no?
or the better way, without pic , I wish to command DIRECT from serial port, to be able to play a little with that matrix and after I am satisfied with the pattern I like THEN I will write it into the pic and use it like a stand alone product.
thanks.
|
|
|
|
|
I can't help you with testing boards (I used breadboard for little tests and "proper" PCB for bigger things, as I had H/W designers available to steal bits from)
I think your best bet at this point is to start looking at PIC tutorials - Google will find plenty - and working from there, or my advice will probably start introducing problems such as lack of de-couplers, wrong resistor values, etc. PIC experts will be able to help you better I think. It's a good processor range, though.
But, in overview, I would have something like this:
PC communicates to your PCB via RS232
PCB has external power supply
PCB interfaces to PC via MAX232
MAX interfaces to PIC via TTL
PIC interfaces to LEDs via buffer IC from the vast 74xxx range
The PIC software can be told to turn on /of LED individually as required. When you have a pattern you like, programm it directly into the PIC.
Don't forget the buffer chips, to reduce the power loading on the PIC and (potentially) expand the number of driven LED's as required.
Strongly suggest you socket everything on the PCB as it is a lot easer to change than cutting dead chips out and fitting new ones!
Good luck - let me know how it goes!
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
well i have a textfile that has a bunch of usernames and passwords in them.
they are in this format:
username:password
username2:password2
username3:password3
etc.
now i want to put each of these into a listview, with each login being on a new row.
for example username is in listview1.subitems[0] and the password is in listview1.subitems[1].
then the next account is the same, but on a new line.
im not too sure in how to do this.
i can only seem to get one of the accounts to go into it.
i want each on a new row.
|
|
|
|
|
StreamReader sr = new StreamReader("File.txt");
string line = sr.ReadLine();
while(line != null)//loop through each line until end of file
{
if(line.Contains(":"))
{
string[] parts = line.Split(':');//you may want to validate unless your certain the input is perfect
//now parts will contain username at index[0] and password at index[1]
//so you can add both to a new line in your listview
}
line = sr.ReadLine();//read in the next line, without you will be in endless loop
}
sr.Close();
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Hi all,
I'm using multiple check boxes. Now i need is to store the multi selected checkbox in a single field of table. Help me with sample code plz.
thanks in advance...
Elizabeth..........
|
|
|
|
|
Not a chance, this is a really bad data design. Store each checkbox result in it's own field. If not your next post will be how to get multiple values from 1 field, and the one after would be how to query that field.
DON'T DO IT.
Never underestimate the power of human stupidity
RAH
|
|
|
|