|
The standard ListView doesn't support hiding columns. You have a couple of options.
You could extend the ColumnHeader class to include a Hidden proerty, then you would have to ownerdraw the ListView control draw the columns and items based on the Hidden property.
You could just make the width of the hidden column 0, but that doesn't mean that the user can't just resize the column to show the hidden column again.
You could avoid putting the hidden data into the Item.SubItem() collection. And instead, put the data into a seperate array, but keep the array index linked to the item index in the ListView:
ListView.Item() SubItem(0) SubItem(1) SubItem(2) | HiddenData()
(0)"Item1" "SI1" "SI2" "SI3" | (0)"HideMe"
(1)"Item2" "SI1" "SI2" "SI3" | (1)"HideMe"
(2)"Item3" "SI1" "SI2" "SI3" | (2)"HideMe"
(3)"Item4" "SI1" "SI2" "SI3" | (3)"HideMe"
This way, when ever the user selects an Item, say index 2, your hidden data will be in the array HiddenData(2).
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I was thinking everytime I change the size of dialog, I change the column and whole list view width so that you don't see the last column of ListView.
what do you think?
|
|
|
|
|
I've got an issue with trying to select a value from a combo box, using code.
I have a form that opens up, with a bunch of controls. This form represents a record in a table. I'm currently using a dataset to go and get that data, and then populating the controls with the individual values from that dataset.
There is a combo box on the form that is populated using an object that holds the ID of the value, and the display text. These are then assigned to the combo box as ValueMember and DisplayMember respectively.
When I ask for the SelectedValue, I get the ValueMember, which is all well and good.
However, what I want to do, is when the form loads, I want to return a dataset containing the ID that relates the ValueMember of the combo box, and select the value in the combo box that relates to that value, so that I get the corresponding DisplayMember.
I've got no idea how to do this at the moment, and it's driving me potty! Anyone...anyone... Bueller!
TIA
Tom
|
|
|
|
|
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?
|
|
|
|
|