|
If I understand the problem correctly... You're trying to select a value in a combobox using code? Correct?
Notice that SelectedValue is a get/SET property. You can set the value of the SelectedValue property to the ValueMember that you want and it should show you the corresponding DisplayMember in the ComboBox.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks - just by writing a response, trying to show there was nothing wrong with my code, I've realised what I was doing wrong. The class I use to create an object to fill the combo box holds the ID as Long , and I was casting the value coming from the dataset as an Integer . Once I changed the cast to a Long , it worked like a dream.
I'm sorry for wasting your time!
Many Thanks
Tom
|
|
|
|
|
Good Day Every Body,
I wonder Whether any Body work on linking PC with a Machine,
I need to link a weight Indicator Machine with my PC ,
I need a result as Text File,
I don't have any Idea about Interfacing PC with Machines, through COM Port.
Please If any body can help with any small info
Lool
|
|
|
|
|
First question may seem stupid, but do you have to documentation on the interface on the scale? Without it, your going to have a tough time doing this.
Second, you'll need the proper cable to go between the PC and scale.
Third, you will need a Serial Comm class library to help you talk to the COM port. This is because there is no native .NET BCL support for serial/parallel communications. There are examples on MSDN here[^], and here[^]. There is also an example on CodeProject here[^].
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
You can user Visual basic's Comm Control and then you specify port as 0 or 1.
-Prerak
|
|
|
|
|
Good Day Every Body,
Lool
|
|
|
|
|
Gooday!
Now what....???
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi
I've read some of the articles about using the propertygrid and it seems that i can make it work allright.
Right now i need to display a number of options and make them available for editing. For that the propertygrid seems perfect. Only problem is that i have these options in a database and it is an essential thing that the number and properties (integer,string, list selection) can be freely defined in the database. That does not seem to be compatible to the need to supply a class to the property grid.
So... can I in runtime a) change the properties of the class supplied to the propertygrid, in this way i can supply a "generic" class and live with the limitations in size or can I b) create an object virtually "bit by bit" and then supply it to the property grid ?
Kind regards
Thomas
|
|
|
|
|
Can anyone help me with any sample code for sending a SMS in VB.NET? Any help will be appreciated. This is quite urgent, I need this for a project that has to be completed soon.
|
|
|
|
|
There are TONS of examples all over the web. Just search for 'SMS message VB', or click this[^] for the results from Yahoo.
You'll need an account and password on an SMS message server service. Most sites now charge a per/message fee or have a flat fee for X number of messages per month. The 'Free' sites are not reliable enough for production use and don't always work with all phones.
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
Thanks for the link.
Aaron Eldreth
TheCollective4.com
My Articles
While much is too strange to be believed,
Nothing is too strange to have happened.
- T. Hardy
|
|
|
|
|
i need to know of a way to make other variables pointers in vb.net. Is there anyway to do this. I know in 6.0 you could use the strptr or objptr or varptr. I need to know how to do this same function in .net.
|
|
|
|
|
Everything is a pointer (now called a reference) in .NET except for value-types (things like integers, booleans, floating point numbers, and so on).
I don't know how you would get a pointer in VB.NET, although you can do it in C# by creating some unsafe code - but VB.NET doesn't support the unsafe context.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
The Second EuroCPian Event will be in Brussels on the 4th of September
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
|
|
|
|
|
this is my initial variable:
Dim Operators() As String = {"=", "<=", ">=", "+", "-", "!="}
Dim Codes() As String = {"UC", "CT", "LS", "PR", "P1", "P2", _
"P3", "P4", "P5", "P6", "P7", "P8", "P9", "PQ", _
"QT", "PC", "SR", "MV", "SC", "DC"}
Could someone help me to how use regular expression to check an input of string is valid in the following order:
Codes Operators Integer
For example: UC = 3
Thanks.
John
|
|
|
|
|
Hi John. How about this regular expression?
^(UC|CT|LS|PR|P1|P2|P3|P4|P5|P6|P7|P8|P9|PQ|QT|PC|SR|MV|SC|DC)\s*(=|<=|>=|\+|-|!=)\s*\d+$
- The initial
^ makes the match at the beginning of the string (i.e. nothing can come before the code). - Next is a group of choices (your codes) surrounded by (parentheses) and seperated with vertical bars |.
- The
\s that follows means to match white space and the asterisk * says "zero or more times"... so the \s* allows for optional white space between the code and the operator. - Then the (=|<=|>=|\+|-|!=) group is another list of choices, seperated by
| , surrounded by (...) like before. The + sign has special meaning in regular expressions, so it requires an escape backslash \ character in front of it to treat it as a literal + sign. - Next we have another
\s* , again allowing for optional whitespace between the operator and the integer - We use
\d+ to match one or more digits from 0 to 9... the \d means match a digit, and the + means "one or more times". - Finally, the
$ dollar sign at the end matches the position at the end of the input string, meaning that no other characters may follow the digits.
I hope this helps.
|
|
|
|
|
Thank you so much. This really helps.
John
|
|
|
|
|
I have list of document of type word,pdf and tif images. When open the documents and print , i expect the printing resulted in the same order.
But the word documents are printed first and then pdf and the order is not what I printed.
How to avoid this jumble and maintain the order in which i printed.
Regards
Thangavel
|
|
|
|
|
How are you printing these documents? Are you selecting them in Explorer, right-clicking and picking Print?
Or are you trying to print these from code? What does your code look like?
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am trying to print them from code. Printing in a loop using the one of the following code for the respective documents .
'Print '.tif' image using Kodak Image Edit control.
imgEdForTIF.Image = gstrFilesPath & "\" & txtEDockets(intI)
imgEdForTIF.PrintImage
'Print for Word document
objWordApp.Documents.Open (gstrFilesPath & "\" & txtEDockets(intI))
objWordApp.ActiveDocument.PrintOut Background:=False
objWordApp.Documents.Close wdDoNotSaveChanges
'Print for PDF files
Call ShellExecute(hwnd, "Print", gstrFilesPath & "\" & txtEDockets(intI), "", "", 0)
lngHwnd = FindWindow(vbNullString, "Acrobat Reader")
SendMessage lngHwnd, WM_CLOSE, 0, 0
|
|
|
|
|
You're printing all of these nearly at one and depending on the Print routines for each to do the printing for you. Not a problem really, it's what anyone would do.
The problem your running into is that Word uses a background Print on a seperate thread. Your also using ShellExecute to Print .PDF files, which means Acrobat has to load, load it's plugin's and the load the document, then print. Takes a while...
With all the printing being done on seperate threads, it's, literally, a race to see which application can start it's print job first since they are all going at the same time.
The bottom line is, with the methods that you've chosen, there is no way to print the jobs out in any controlled order. You would have to either monitor the PrintQueue to catch when the job starts before firing off the next (not easy!), or you would have to monitor each application to see when it starts the actual printing (not easy!), or you could drop Thread.Sleep(oh I don't know, say5000)'s between each print job, thereby putting 5 seconds between the launch of each print job.
The final method works, is easy to implement, BUT (a very big BUT here!) It in no way guarantee's that the print jobs will come out in the order you launched them. The bottom line is there is no easy and reliable method to get the print jobs to come out in the order you want them.
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks.
Putting the delay works , but i understand the risks.
Is there any other design i can choose to control the order of printing. USing PS or prn files?
|
|
|
|
|
Ummmmm...let me think about this...
OK. You MIGHT be able to getaway with this....
You could start all of your print jobs, but instead of printing to the printer, you would print to a printer object that was told to print to a file instead. This would send all of the page description code (PCL5, PCL6, PostScript, whetever it is...) to a file instead of the printer. You would have to wait until these jobs were completed. (I don't know your going to do this!) Then copy the files, in order, to another printer setup to go to the printer this time and redirecting LPT1: to it.
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for your time.
Actually I tried to read the print job status using a API:
A seperate program will polling and writing the status to aceess and after the print read command read the access to check if that document reached the status printing. here for very small documents i may not be able to read the status and that time i used to wait for 30 seconds.
This works fine but the pproblem now is that some of the PDF documents printed with only one page. The remaining pages are missing. I am giving the next print command only after the previous document status in printer is "printing".
The same behaviour when i print without any delay . But no missing of pages when i print with 15 second dely.
Any idea why this is happening.
Thanks and Regards
R Thangavel
|
|
|
|
|
I've never heard of the problem. Sounds like an issue with Acrobat, or whatever component is doing the printing.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|