|
You can access the controls by name, or by index, on the Controls collection.
Christian Graus - C++ MVP
|
|
|
|
|
I tried alot Graus , without good result
i can't access the control on the controls collectoin by name
by index is allowed but the index is changed and i can't get the control new index , by name will be so easy but how ?????????????????????
untell now i spen 3 hours withount good result
jooooo
|
|
|
|
|
To access by name, just use the name, you don't need the controls collection.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi!
I have a datagrid filled with a dataset table.
I would like to know if it is possible to hide a one of the datagrid column?
thanks!
Hugo
|
|
|
|
|
Hey hlortie,
To answer your question, you want to access the .Visible property of the DataGridView.Columns("ColumnName") object. So if your dataGridView is called "dgvProducts", and your column is called "Amount", you could effectively hide it by writing the following:
dgvProducts.Columns("Amount").Visible = False
Hope that helps!
Jonathan Sampson
www.SampsonResume.com
|
|
|
|
|
I've found the way to do it:
'Assign style to datagrid
tStyle.MappingName = datagrid.DataMember
datagrid.TableStyles.Add(tStyle)
'Hide column
datagrid.TableStyles("Table_name").GridColumnStyles("column_name").Width = 0
|
|
|
|
|
The way I told you will work as well, and is actually the way you're supposed to do it. Your way allows people the option to widen the width, and see the information you were hiding.
May I suggest you hide the column if you sincerely want to hide it. Setting the width to 0 is not hiding it.
Jonathan Sampson
www.SampsonResume.com
|
|
|
|
|
Is there some way that I can detect if a user starts up an application? I'd like to build a monitoring tool that is always running in the background and detects when specific applications are started so that I can log the usage of the applications.
Thanks for any suggestions.
Regards
Tom
|
|
|
|
|
You can build a windows service that starts a timer which on each tick will check the process list, and log whatever u want to log.
A probably better way to do it is through WMI, you will need to create a callback on WMI when a process starts, that way whenever a process starts, WMI will execute the registered callback.
|
|
|
|
|
|
Sorry for sending blank message
the problem is I'm designing a dataform which is liked with sql server 2000 table , on the table i have tree or more choices and I want the user to choose only one of them ,
how can i Binding data to the radiobutton ,
thanks for all
jooooo
|
|
|
|
|
I am getting an invalid column error from oracle from the following code: I checked the columns and they are ok, any ideas ???
"Select A1.PART_CODE, A1.PO_NUMBER, A1.PO_LINE_NUMBER, A3.RECEIVED_DATE " & _
"from FINPROD.POP_LINES A1, FINPROD.GOODS_RECEIVED_LINES A2, FINPROD.GOODS_RECEIVED_HEADERS " & _
"WHERE A1.PART_CODE = sq(txtBox1.text) " & _
"AND A1.PO_NUMBER = A2.PO_NUMBER " & _
"AND A1.PO_LINE_NUMBER = A2.PO_LINE_NUMBER " & _
"AND A2.GRN_NUMBER = A3.GRN_NUMBER " & _
"ORDER BY A3.RECEIVED_DATE"
silver-gray
|
|
|
|
|
The database is not aware of your text fields. You have to put the value from the text field in the query, not the name of the text field.
---
b { font-weight: normal; }
|
|
|
|
|
There are 3 different table involved here. The table A1 will return many rows since it is the purchase order line items table. the other will return one for each of the rows in A1.
I don't understand your reply. This is a select command were the data in txtBNox1.text is the only field that has enterable data in.
Please explain your reply.
Thanks
silver-gray
|
|
|
|
|
The text is converted via the following function
Public Function SQ(ByVal Textin As String) As String
SQ = "'" & Replace(Textin, "'", "''") & "'"
End Function
silver-gray
|
|
|
|
|
The database is not aware of your function either.
You have placed the function call and the reference to the text box inside the string, that means that it's not code, it's just a part of the string. The string will be sent just as it is to the database, and the database couldn't do anything with it even if it did understand what it was, as it doesn't have access to either your function or your text box.
---
b { font-weight: normal; }
|
|
|
|
|
Thank you. Now I understand
Thanks
silver-gray
|
|
|
|
|
Hi,
Can anyone let me know how can I restrict special character like ', " to be entered by the user in the text box?
Thank you,
Regards,
Deepa
|
|
|
|
|
You could handle the TextChanged event, look for the special characters and strip them out.
|
|
|
|
|
Hi
You could try handling the Textbox.TextChanged Event and check the last character for the characters you want to ignore and remove it if it's illegal.
Kevin
|
|
|
|
|
You can also handle the textbox's KeyDown and KeyPress events to check for, and block, illegal characters. There is an example in the KeyDown[^] docs.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi,
I want to use the class System.io and wonder where I put this class in my code. I put the imports system.io at the assemblyinfo.vb but no success in a form when I try and get some info e.g. my.computer.name or my.application.assemblyinfo.companyname.
The squickally line appears below my.
What simple thing am I doing wrong?
|
|
|
|
|
directred wrote: I want to use the class System.io
That is a namespace, not a class.
directred wrote: I put the imports system.io at the assemblyinfo.vb
Don't. It won't do anything for you there.
directred wrote: What simple thing am I doing wrong?
Put the Imports System.IO at the top of each file that needs to use classes in that namespace. Alternatively, you can use the fully qualified name for each class. e.g. System.IO.FileStream
|
|
|
|
|
Example:
Imports System.IO
Public Class FileSystem
Function FileExists(Byval sFile as String) as Boolean
If File.Exists(sFile) Then
Return True
Else
Return False
End If
End Function
End Class
SMC
|
|
|
|
|
You might prefer to reply to the original poster rather than me. It wasn't me that was looking for help.
|
|
|
|