|
NEVER use VB6 functions. DateTime.Parse does not format dates, it tries to get a date out of a string. Use the ToString method, you can pass a format string as an argument to turn a date into any string format you like.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
how wil i interact with any hardware using dotNet..?
For example Barcode reader.
J A Nasir K
|
|
|
|
|
There are many kinds of barcode scanner that work in many ways.
If it is a serial one, you should look at the io.ports.serialport namespace.
If it is a "keyboard wedge" type (i.e. emulates keystrokes), then you dont need to do much except look at the "onkeydown" event of the form. Quite often this type of scanner will send a keystroke such as "F20" before the actual barcode.
If it has OPos drivers, there is the Microsoft POS for .NET SDK which you can download and have a look at.
As for other hardware - I've no idea.
|
|
|
|
|
This is a bizarre question. The answer is, read the manual that comes with the hardware. Not all hardware works the same way, as someone else has pointed out already.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi all,
I was wondering if anyone out there knew of good VB.NET beginner tutorials suitable for my 10yo nephew. He is a bit of a geek, but being only 10 I think a lot of the books and tutorials aimed at adults could be beyond his grasp.
If you have any experience with tutorials or books for the younger people out there, please let me know.
Thanks.
|
|
|
|
|
Visual Basic for Dummies is a good book. There are a lot of books about Visual Basic in your local library, with clear images. Your nephew is a quick learner, isn't he?
--Zaegra--
|
|
|
|
|
I don't know of anything specific for children, but the Head First series of books could have what you are looking for. It contains lots of fun ways of learning as well as crosswords and other puzzles at the end of the chapters as a way of retaining the information.
|
|
|
|
|
One book that I used/manipulated when I was first learning programming was: VB.NET Hacks & Pranks. The book is not as bad as it sounds, most of the examples are fun and easy to learn.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Thanks for the answers. I was thinking about the Dummies book, but was unsure how good it was.
I will look for the Head First and Hacks & Pranks books.
Unfortunately we have a limited range of titles available here in my area of Australia. I end up getting most of my books from Amazon, but I can't flip through the books there, so I'll if these are available locally first.
Thanks again. Hopefully we'll have a new VB programmer in our midst soon
|
|
|
|
|
hai friends
i m creating a help file for my windows application project with "HTML work shop"
i m in starting stage
first i m creating html files
in one of the html files , i used a image and the image path is like this ..
"D:/Images/Img1.jpg"
my problems is my client can install the software in any drive
he may intall the software in "E" drive
then it is not displaying the image ..
plz help me ...
thanks in advance
vijay
|
|
|
|
|
use relative paths.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Try using Application.StartupPath .
This gets the folder where your application is currently running.
Good Luck!
--Zaegra--
|
|
|
|
|
But, he's not generating HTML, he's just storing HTML files. So, he needs to use relative paths and get it portable that way.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi all
I have 3 textbox in the form and i make the Property MaxLength to 3 and i want that when i enter 3 letter in first textbox the cursor move auto to the next and so on
-*-*-*-*-*-*-*-*-*
To Be Or Not To Be
(KARFER)
-*-*-*-*-*-*-*-*-*
|
|
|
|
|
capture the keypress event, and when the third key is pressed call the Focus() method of the next textbox.
To be clear, don't count keypresses, check the length of the string. And keyup may be a better one to use.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Use KeyPress event of first text box to check length text and if it is three move focus to second text box. Such as –
-------------------------------
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If Me.TextBox1.Text.Length = 3 Then
e.Handled = True
Me.TextBox2.Focus()
End If
End Sub
-------------------------------
-Ajay.
-------------------------
www.componentone.com
-------------------------
|
|
|
|
|
Thanks for repeating my answer, only what you've posted, requires pushing a fourth key, which never appears in either textbox, in order to move focus.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
If you replace Textbox1 with sender then you can handle both TextBox1 and TextBox2 with the same method
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Except you would be better to write a class to handle this, so you can easily set what textbox2 is, for each textbox.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Ok I'll bite - why.
Having a single method to service the multiple textboxes seems the most efficient (assuming you do not want to reuse it outside this form)
Ah, I had to read that 5 times to get it - set the destination/next textbox. I would have thought either hard code the target or use the form tab order to identify the next control.
Oh sh;t now I remebered why I hate these things, I just envisaged a complete UI class to handle all the silly operations that can crop up shudder.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Yeah, I guess it depends on if you expect to reuse it across several forms, etc. If you had three textboxes and that was it, you could just have a switch statement or use the tag on the textbox to identify the next one or something.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi
i want to ask if i have one connection to accesses database how con i writ it ons and use it in all forms do i have to write it in model and call it form lode
also i have some function and i want to use it in more than one form do i write it in model and the type is public
thanks
|
|
|
|
|
If I understand your questions correctly, here are the answers.
If you need to access a database from multiple forms, put all of the database code in a module and call the functions or subroutines from there.
The same answer applies to the functions: put them in a module.
Also, think about reusing the code in other projects. Don't hard-code connection settings, etc, pass them into the functions.
Tim
|
|
|
|
|
thanks that what i mean
but i want to ask do i have to but it in form_lode sub and it will be visible to all functions and sub in the form
|
|
|
|
|
Add a seperate module to the application and make the functions/subroutines public. They will then be visible to the entire application.
The database access does not have to be done in the form load; it can be done wherever your application needs it.
|
|
|
|