|
Your first step should be to remove references to the VisualBasic namespace. I suspect this is where Redim and so on are coming from. VB.NET contains a lot of bad stuff from VB6, only because MS was forced into it by people complaining. They are all in that namespace. Delete that, or you'll end up coding VB6 in .NET and not get the full benefit of moving.
If it's VS2005, you can create a List<baseType>, which is a generic container, to which you can add and remove objects at will. You therefore don't need to redim anything. If you ever need an array, those containers offer methods that return them.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Did some reading about Lists and generics and they look really useful. I'm not sure though how Lists and generics can solve my main problem (which is having the 'doSomething' sub work with the list as if it is a list of 'clsTest' objects while the 'main' sub can work with the same list as if it is a list of 'clsTestExtended' objects) but maybe that will become obvious if I do some more reading on the subject.
Best Regards,
Anders
|
|
|
|
|
I need to know how to make the DateTimePicker control in VB 2005 to basically real-time update itself. I want the DateTimePicker to keep track of the time. Guidence?
|
|
|
|
|
Well, the control really wasn't meant to be used the way you want to, but it's probably possible if you drop a Timer control on your form, set it for 1000 millisecond interval, then handle the Timer's Tick event. In the event handler code, just set the DateTimePicker's Value property with the current DateTime.Now().
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I can't get motherboard name on visual basic 2005. What way i can use instead of WMI functions???
because with WMI doesn't work!!! =(((( if somebody knows way please mail me: serg_212@mail.ru
-- modified at 17:15 Thursday 30th November, 2006
|
|
|
|
|
WMI *does* work.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
The WMI method is about the ONLY method you have. But, it will only work if the MoBo manufacturer includes the proper WMI Provider drivers to actually supply the information to WMI.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
O thank you for your answer but when i install soft witch determine motherboard name, temperature,
voltage and etc and this program is really works. And i'am very suprised when my code doesn't work!!! =(((( I want to know what method is use by that programms in gettting motherboard name????
|
|
|
|
|
Because the app doesn't use WMI to get it's information, it has to use the Win32 API function GetSystemFirmwareTable[^] to get this kind of information. There is no support for it in the .NET Framework BCL. Beyond that, it's a custom read of physical memory locations.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
O thank you!!! For this moment I didn't know a way(instead of WMI of course) in getting hardware information and etc.Later, I want to test this API function on Visual Basic 6!!!! I think it will work!!!
|
|
|
|
|
I'm just learning VB.NET and am writing some code that will poll the network and display status boxes within a form. This works fine using something, displaying a nice status strip kinda thing about 50 pixels high (+ the title bar).
But ... Now I come to rotate the form to show it vertically, and find that it seems to have a minimum width which is rather wide !!!
I find that setting the MinimumSize doesn't help. And trying to set the width in the code doesnt help either. It wont get smaller than 123 pixels. This restriction is also experienced in the Design window if manually creating a form.
If I remove the minimize box and maximize box from the form I can resize it to a narower size when the program is running (around 65 pixels), but the 'size' function wont take it to this width.
Now I guess there is something limiting the narowest width that you can chose for a form, but it does seem rather daft.
Maybe I shouldn't be using a Form, but it does everything I want. I have searched the web and the forums and can't see any reference to this restriction, which makes me think I'm missing something obvious !
Please help put me at rest and get me thinking about something else.
Thanks
Nigel
|
|
|
|
|
Probably because a small form like that is seldom ever used. Try changing the FormBorderStyle to SizableToolWindow or FixedToolWindow to see if that gives you what you want.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Oh my !!!!!!!
Thats exactly it !!!
I can't believe it. All those days of searching and it was that easy (for you of course).
Much appreciated, your my hero for today.
Please award yourself a gold star.
Nigel
|
|
|
|
|
I programmed a windows service that sends email alerts based on database returns... The problem is as Follows..
Background:
When I loop through the records I am building a large string (i.e. Result += ) for a mailmessage.body and including the HTML tags ... The record lengths are of various sizes and always random.
Issue:
My issue is when it sends the message, the string is split up after 989 characters and a ! is entered in the string... If the ! is in the middle of text it is not as much of an issue... I just see a ! in the mail message; but if it is put in the HTML Tag the message goes to Cr*p...
Does anyone know how I can prevent the ! from being placed in the string or another method to avoid this..
Thanks in advance
Adam Downs
|
|
|
|
|
Step through your code that builds this string and watch to see what the ! comes from. If you get through your code and just before you call Send , it's still not in your string, it's probably being inserted by your mail server.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
It is not in the string prior to the send function... Where do I go from here if it is put in by the mail server?
|
|
|
|
|
It's possible that there is a line length limit on the mail server, it's just a Telnet session after all... Try adding CarriageReturn characters in appropriate places in your string instead of making it one very long line.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Carriage Returns Did the Trick...
Thanks Alot!
Adam Downs
|
|
|
|
|
Hey Guys,
I made an application in which i had used dynamic generation of picture boxes. I have one picture box and the dynamic generation of the picture boxes are duplicate of the one that i already have. Even then the performance is really not good and it takes hell lot of time for the thumbnails to load in the picturebox.
Is there is good logic that i can use for this. Anything that just loads up everything instanetaneously?
Thanks !!!
Ankit
|
|
|
|
|
The performance of the PictureBox is dependant on the ORIGINAL size of the image your stuffing in it. If you're telling the PB to load an image from a file that's, say, 3000x3000x32bits, it'll take a while to load, even though your probably scaling it down to fit in a box that's 100x100.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
IF you are doing anything non-trivial with images, you should abandon the picturebox, and draw it yourself. And yes, use the DrawImageUnscaled method for speed, and make sure your image is the right size, so you don't waste memory.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Dear Friends,
Seeking help from Pros on how to write application using .net 2005
for a Mobile computer running windows CE.
Application also need to have a databse.
There are few of articles. But difficult to understand for a beginer
always share to enhance your knowledge...!
|
|
|
|
|
i want to make a cyber cafe software almost i did but i don't know how to give permission to start the timer to the client in netwrk.the sever can watch all activity and lock and unlock client computer in lan if any body have idea to lock and unlock the remote computer in lan then contact me at manojkmandal@hotmail.com
|
|
|
|
|
Try to separate what you write into sentences, so that it gets readable.
Expect replies in the forum, not in your mailbox. The intention of a forum is that people can collaborate to find answers, and that other that just you may benefit from the answers.
---
b { font-weight: normal; }
|
|
|
|
|
Yup, I am a newbie to the forum and to VB.Net. I am doing a window application for school assignment. I need to make a app with (First Name), (Last Name), Books overdue,Amount overdue. Also, I need 3 buttons, one for (Exit) (Clear) (Calculate)Here is the directions..
You are to create a Visual Basic.NET application consisting of a single form that will do the following:
1) Allow the user to enter the student’s first name and last name in separate text boxes.
2) Allow the user to enter the number of books that are overdue.
3) Allow the user to enter the number of days the books are overdue. You may assume that all books were checked out on the same date and are due on the same date.
4) Calculate the fine by multiplying the no of days late by $.25 by the number of books.
5) Display a picture of a book on the form. (BOOKS03.ICO)
6) Clear the text boxes so the user can easily enter the information for the next student.
7) Display appropriate Tool Tips for each of the controls.
8) Display a sentence containing the student’s name (first and last) and the amount they owe (formatted for currency) in a label. (e.g. Joe Blow owes $3.75 for overdue books.)
9) Provide buttons to allow the user to calculate and display the fine, clear the form, and exit.
Special
Considerations: 1) All fields must be clearly labeled and have access keys to allow keyboard access.
2) When you clear the text fields the insertion point should automatically position to the first name text box.
3) Focus should follow a logical tab sequence.
4) The escape key should exit from the program.
If i can get some help here please, I would appreciate it. I really have no idea on the code stuff. I am lost...Please Help..Thanks
gary
Gary Skinner
Michigan
|
|
|
|