|
Hi,
Is there any one to help me out using of Comm events in .NET.i just want to know which event .NET is equilant to "OnComm" event in VB6.or else tell me where exactly i would be able to get more info about Comm ,as .NET books are not covering this area.I would be eagerly waiting for some kind of help..
pls
|
|
|
|
|
If you are trying to use the Serial comm, for serial communication, I download a lib. that you can use just, tell me and I will sended to you.
ElRaptor
|
|
|
|
|
Hello Shihab:
I thing you are missing a line you need tell the library to read from the port and how many bytes your reding, this is the part of the code I am using to read:
Dim Cadena as string
' As long as there is information, read one byte at a time and
' Save it.
While (ObjComm.Read(1) <> -1)
' Save data read
Cadena = Cadena + Chr(ObjComm.InputStream())
End While
First I check If there is information to read and I tell the function to read only one byte, then I read the byte and I add the Character to a string.
You are using the InputStreamString, and if you look in the code this function uses the InputStream function to read each byte, I havent use this Property but I thing that you need to define the quantity of bytes to be read.
Hope this helps
JA
PS: Happy New Year!!!!!!
|
|
|
|
|
Hi all, hope you are having a bug free weekend!
I have attempted to write a function which scales and translates a graphics path.
If you describe a path as a square, I want to be able to draw your path twice...the first time using the size you specified in the path, then the second time I want to move it and reduce it (scale it down) by a specific number of pixels.
I attempted to write code to do this, but I fear my limited mathematical abilities are whats causing me to see rather odd results in size and position.
The thing is I DO NOT want to reduce the second drawn path by a percentage. I want to move it in by X,Y pixels then of course reduce its width by X*2 pixels and Y*2 pixels, so that the second shape always stays centralised with respect to the first. What this would mean is that I can have user defined button shapes, where I can maintain somekind of consistent look with pre-programmed rectangular and circular buttons which have gradient filled borders.
Can anybody offer me some code which produces a matrix that causes a translation and appropriate scaling factors to produce the required results? I think I only need the code to set the appropriate matrix properties, so you don't need to give me a big story. I will look at your code and probably see where my own is lacking.
Thanks in advance.
Nursey.
Nursey
|
|
|
|
|
I'm writing a macro that will tansfer information from a form in a Word documet to an Access database. I have parsed all the information I need into strings, and have found the automation commands for opening the Access database, I cannot figure out where to go from there.
Do I open a form in Access and use the form's controls to set the text of the textboxes? I cannot figure out how to set the point for the form or control from the Word macro. Is there a better way to do this?
|
|
|
|
|
Ok,I got this figured out you have to check the Microsoft Access 9.0 Object Library in the tools/references.
|
|
|
|
|
hello friend...
just send me any mail id so that i can send u the zip file....that might solve ur problem
With Regds
Vipin Bokariya
|
|
|
|
|
I normally code in C#, but I'm currently using VB.net for one of my projects. I have the option "Allow me to edit VB source code files while debugging" checked, but cannot do so. I get the message "Cannot currently modify this text in the editor. It is read-only." Does this feature not work with VB.net? Than doesn't seem likely, since the option is given. I do not have the same problem when using C#.
What am I missing?
Charlie
Here I am. Love me.
|
|
|
|
|
I'm using VS 2K3 and don't have that problem. All I did was check the Tools/Options/Debugging/Edit and Continue/'Allow me to edit VB source code files while debugging' box, restart VS and everything worked! BUT!!! It will only allow you to edit the files during a breakpoint! You can't edit the files while your code is actually running. You have to stop the code at a breakpoint first.
RageInTheMachine9532
|
|
|
|
|
Thanks for the response.
That's a little disappointing. I'm used to being able to edit the source code whenever I please, no matter the state of the app.
Oh well, such is life, I guess.
Charlie
Here I am. Love me.
|
|
|
|
|
I can open up to 5 Webbrowser controls on 5 separate forms. A medium size panel control on each form is transparent. I can only open up to 3 forms before memory is exhausted. As a test, when I eliminate the transparency I have opened the same form up to 50 times without any problems.
Has anyone else run into this problem using the TransparencyKey? I can’t find anything at MS on memory consumption and the transparencyKey property.
Thanks, GregC
|
|
|
|
|
as topic, if i wan to create an array where the content of the array can be edited by form1 and form2, how i going to do it?
for example the content of array is {1,2,3}
form2 change the content to {1,2,4}
form1 also can see the changes in the array
where i should declare the array and wat is the format?
and how am i going to call the array in form1 and form2 for modification?
any help is greatly appreciated...thz...
|
|
|
|
|
how t to draw 3D or 2D charts in VB.net programatically.
i know how to draw it by adding it at design time.
Nothing ...........................................................
|
|
|
|
|
as topic, how do i check the data type (integer and string) of the user input in a textbox??
if i wan the user to input number 123, but he/she entered 123A, how i going to detect there is an error of input?? any help is greatly appreciate...
|
|
|
|
|
Try something like:
Dim MyInteger As Int32
Try
MyInteger = Convert.ToInt32(Me.TextBox1.Text)
Catch fex As FormatException
' Do something here to handle the input being wrong
' like "123A"
Catch oex As OverflowException
' Do something here to handle the input being out of
' range (i.e. It is a number but is it too big for
' an 32 bit integer.
End Try
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
Enumerators in .NET: See how to customise foreach loops with C#
|
|
|
|
|
thanks again for help
this solution is works for checking integer, but seems like doest work on character?
i need to check a user input whether it is charecter type...
ur help is greatly appreciated...
|
|
|
|
|
Sorry, I'm don't quite understand. I thought you wanted to check that the input was an integer. Is this another control you want to check? Can you be more specific about what you need it to do.
Thanks.
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
Enumerators in .NET: See how to customise foreach loops with C#
|
|
|
|
|
One way to validate user input is using regular expressions. Regexes can get pretty complicated if you need them to do more advanced validation, but simple things like making sure only numbers are input are simple enough.
This test looks for the beginning of a line, followed by one or more numbers, followed by the end of the line:
Imports System.Text.RegularExpressions
<br />
Dim re as new Regex("^\d+$")<br />
If re.IsMatch(myTextBox.Text) Then<br />
'Input passed the test<br />
Else<br />
'Failed<br />
End If<br />
To accept only non-numbers: "^\D+$"
To accept only strings in the format 123A: "^[\d]{3}[A-Z]$"
There are more variations than you can shake a stick at. You could, for example, make sure input is in the format of a US social security number or a phone number or a URL or whatever else you can think of.
Charlie
Here I am. Love me.
|
|
|
|
|
thanks for help
what if i wan to accept only character A-Z and a-z ?(no included symbols such as @#*%_)
wat is the regularexpression format?
To accept only non-numbers: "^\D+$"
this format accept only character but it also accept symbols which i dun wan be included...
ur help is greatly appreciated...
|
|
|
|
|
Anything in square brackets will match one character. The hyphen specifies a range. For example, [a-m] will match 'a' or 'g', etc., but not 'n' or 'A' (It's case sensitive, although there's an \i switch to compare in a case insensitive manner.) So [a-zA-Z] is what you're looking for. \w is similar, but also matches _ and 0-9
Mastering Regular Expressions[^] by Jeffrey E. F. Friedl is a great book about regexes. The author uses perl for the bulk of the book, but there is a section specific to .net and .net uses mostly perl flavored regexes, anyway. (Though in an OO way). If you don't use them enough to justify purchasing a book, VS.Net's online help has quite a bit of info on them.
Charlie
Here I am. Love me.
|
|
|
|
|
the default setting of combo box enable user to edit the listed in combobox just like normal textbox, but i cant find any property that can disable this option, i wan the combobox to be read-only to user...how i going to do that?? anyone can help me??VB.Net
|
|
|
|
|
Try this:
Me.ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList
Or just set it in the designer.
The defintions for ComboBoxStyle are:
DropDown The text portion is editable. The user must click the arrow button to display the list portion.
DropDownList The user cannot directly edit the text portion. The user must click the arrow button to display the list portion.
Simple The text portion is editable. The list portion is always visible.
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
Enumerators in .NET: See how to customise foreach loops with C#
|
|
|
|
|
thanks man, ur solution works!
however seems like the combobox will no default value when form loaded, the combobox is empty
how i going to set the first item in the combobox to be the default item when form is loaded?
|
|
|
|
|
Use SelectedIndex or SelectedText
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
Enumerators in .NET: See how to customise foreach loops with C#
|
|
|
|
|
thanks man, u helped me alot, i am a beginner in vb.net
hope the questions i asked wont make u feel boring...
|
|
|
|