|
Class starts at 8.30. Make sure you're on time and bring pen and paper to make notes
I are troll
|
|
|
|
|
All you had to do to find this out is use any search engine. Here, let me show you[^].
|
|
|
|
|
He can't google he is doing his exam and the teachers blocked it but forgot to block CP
|
|
|
|
|
Someone is failing the midterm..
|
|
|
|
|
As I am Using a USB HID Barcode Scanner , I am in need of stop reading the barcode Immediately after the barcode scan and it should be able to start the scanning only after clicking a button
Is ther any simple way for this? Request ur kind help.
Noufi
Thanx.
|
|
|
|
|
No, there isn't. Since the bardcode scanner is impersonating a keyboard, you're getting keystrokes inside your application. Treat them as such.
|
|
|
|
|
Or can we block reading the USB using VB.Net Code
|
|
|
|
|
Yeah, right. Block reading the USB port system-wide? I've got two words for you: Shared System. The app has to share the system with all other apps that may be running at the time. What if those apps need access to USB devices too?? Also, how is the code going to tell the difference between a USB-based keyboard-wedge barcode scanner and a normal USB keyboard.
Lousy idea.
|
|
|
|
|
I have a very simple Windows form in C# with one pictureBox and two textBoxes. When the form loads I want the focus to go to textBox1. I have set the TabStop property to True and the TabIndex to 0, but it didn't work. I have tried:
textBox1.Focus();
and
textBox1.Select();
in both the Form_Load and Form_Activated event handlers, but these have not worked. If I use either of these methods in the pictureBox_Click event handler they work fine!
Can anybody help please?
|
|
|
|
|
Sorry, I posted this on the wrong forum. I have now posted it on the C# forum, so please ignore this one
|
|
|
|
|
How to store DateTimePicker value from a form to an MS Access Database?
|
|
|
|
|
There are two method for store value in database
first one is execute following query
str="insert into tableName(dateFieldName) values(#" & datatimepicker1.Value & "#)"
second one is use parameterized query as following
Dim QueryText As String<br />
Dim QueryValue As String<br />
QueryText = "INSERT INTO tableName(dateFieldName)"<br />
QueryValue = "Values(@dateValue)<br />
Dim com As System.Data.OleDb.OleDbCommand = New System.Data.OleDb.OleDbCommand<br />
com.Parameters.Add("@dateValue", OleDb.OleDbType.Date, 16).Value = datatimepicker1.Value 'here you can use length as you wish<br />
com .CommandText = QueryText & QueryValue<br />
com .ExecuteNonQuery()
in above two method i assume you can manage connection object. If have any problem, then let me know
|
|
|
|
|
its working
thanks a lot
modified on Tuesday, February 3, 2009 5:18 AM
|
|
|
|
|
Hi,
I have a collection of Structures and I need to modify these structures. Am I able to do this without first removing the structure from the collection, making the modifications and then reinserting back into the collection?
I have tried using:
Ctype(Collection.Item("Item"), StructureName).Property = Value
but I get a compile error saying that 'Expression is a value and therefore cannot be the target of an assignment'
I have also tried
Collection.Item("Item").Property = Value
but get a RTE saying that 'Late-bound assignment to a field of a value type 'Group' is not valid when 'Group' is the result of a late-bound expression' (Group is the nam,e of my structure, BTW).
I have modified objects in a collection using the Ctype method but am unable to do it with structures so currently am removing from the collection first. Any advice is appreciated. Thanks
|
|
|
|
|
Have you tried changing the structure to a Class? I have this feeling that as Structures are value types, not reference types, this isn't allowed.
Also, have you considered using something like List(Of T) to hold the items instead (assuming that's possible, of cause)? It will save you casting the values when you want to use them or using Late Binding? Also, it'll mean you won't be able to accidently add the wrong sort of item to the list, which would cause InvalidCastException with code like this. Of cause, if you've considered this, feel free to completly ignore me
|
|
|
|
|
Thanks for your reply.
I didn't want to classes because it seemed to be overkill considering my structures only contain 3 maybe 4 properties. So I thought structures would be more appropriate.
But no, I haven't considered using List(Of T). I'm fairly new to software development and am still finding my feet with VB.NET so was unaware of List(Of T). Thanks for the suggestion, I will give it a try and let you know the outcome
|
|
|
|
|
You could try storing one-element arrays of the structure in the collection. Although "behind the scenes" each things in the collection would be a class rather than a structure (thus adding some slight extra overhead) you would be able to store them by value elsewhere if you wished.
It might also be helpful to create a generic wrapper:
Class simpleWrap(Of T)
Public dat As T
End Class
If you did that, you could store items of type SimpleWrap(of YourStructure) in the collection. I believe that when using generic classes and methods with value type arguments, all code associated with the the classes and methods will be duplicated for each different value type, but in this scenario that shouldn't be a problem since the class has no methods and thus no code.
|
|
|
|
|
Liqz wrote:
I didn't want to classes because it seemed to be overkill considering my structures only contain 3 maybe 4 properties.
As you are casting the values, I suppose that you are using an untyped collection like ArrayList? In that case, there is no benefit at all using a structure, as each structure value will be boxed inside an object in order for the collection to be able to handle it.
That also means that it's impossible to change the separate properties in place. The value has to be unboxed and copied to a variable, where you can change the property, then the value can be boxed and stored back in the collection.
Liqz wrote: So I thought structures would be more appropriate.
No, that's not a good reason to use a structure. A structure is used when you want value type semantics, but what you have clearly contains several distinct values. Usually a structure is immutable, which means that you don't change a separate property. If you want a different set of properties you create a new structure value.
In this case you should definitely use a class instead. Unless you have a specific reason to use a structure, a class should always be the first choise. A structure can be more efficitent in some cases, but then it's also harder to implement it so that it works properly.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Ah OK, thank you supercat and guffa for your advice. It's given me something to think about. Like I said, I am still learning and all of your advice is very valuable to me. Think I will go away and read up on the correct usage of structures before I continue. Thanks again
|
|
|
|
|
Tried using List(Of T) like you suggested but unfortunately I still get the same compiler error as when using a collection. But thanks anyway. I will go away and look at the other types of collections in VB.NET, but in the mean time will stick to my long winded approach!
|
|
|
|
|
I am a gray haired old fox ...... I started to learn programming using Borlands Turbo C++ 4.5 compiler...
So I know I am bit out of touch with this stuff. All I can remember is the following of the day I wrote a small trig program:
#include <conio.h> // console input output;
#include <iostream.h> // Input/Output Stream Controlling library;
#inlcude <math.h> // Basic math function library;
#include <complex.h> // Complex math formulation library;
int main () // Start of the body of the program;
{ // initial area of program script within the body of the program;
float a,b,c,d; //Float not straight integers but decimals and negatives ectra;
cout<<"Please input the Angle: ";cin>>a;
cout<<"Please Press a key to continue";getch();
cout<<"Please input Adjacent: "cin>>b;
cout<<"Please enter in Hypotenuse: ";cin>>c;
count<<"Please enter in Time in Military 100th seconds: ";cin>>d;
float e,f,g,h;
e=1/(d*3.14);
f=(b/c);
g=(1/d);
h=a*(f*g*e);
count<<your awnser is:"<<h;
}return 0 ;}
This use to work but I might have goofed it up some where.. So any volunteers to help me learn VB @008 Express Edition scripting ?
Cause I am a bit lost and need lots of help and patience
|
|
|
|
|
Teaching programming is far beyond the scope of this, or indeed any, forum. There are thousands of free tutorials on the net which will help you get started. Or, you could even purchase a beginners book. If you then have any specific problems or queries while you are learning, post here and I'm sure someone will be able to help you.
|
|
|
|
|
That's not VB at all, but in comparison to C++ you're in for a much easier time. VB.Net is very simplistic, and unlike C++ it is not archaic or complex (to a certain degree) at all. Infact, if you picked up a book, which I hope you do, the first thing you will usually read is "VB.Net / C# is a RAD language", where RAD is Rapid Application Development. Trust me, go to a local book store, and Microsoft has a great series of books for beginners entitled
"Build a program now! using Visual Basic Express 2008" which is entirely recommended for beginners. It will get you off on the right foot about good practices and the basics of architecture. Check it out, you will have decent applications off the ground in no time.
|
|
|
|
|
hii all
how can i clear the variables?
beginner_VB_user
|
|
|
|
|
Could you be more specific?
You may use .Dispose method to delete objects.
|
|
|
|