|
I am new to VB 2005 .Net.
I want to read the table schema from my database and programmatically set the maximum input length of each text column of my datagridview.
However I cannot find the property I need to update. The only examples I have found require you to remove the column and then add it back from a new datagridviewtextboxcolumn. Surely there is a simpler way. Other third party grids allow you to refer to the maximum input length directly.
Does anyone have a suggestion?
|
|
|
|
|
You can use "MaxInputLength" property of "DataGridViewTextBoxColumn".
This Property Gets or sets the maximum number of characters that can be entered into the text box column
|
|
|
|
|
Can you give me an example or code. I can't see how to relate a "DataGridViewTextBoxColumn" to my column. Thanks for your reply and help.
|
|
|
|
|
CType(Me.DataGridView1.Columns(0), DataGridViewTextBoxColumn).MaxInputLength = 10
|
|
|
|
|
Thanks you're a life saver
|
|
|
|
|
I KNOW ENOUGH TO BE DANGEROUS BUT HERE GOES...
I've created a windows application with a Flash file embedded in the WebBrowser URL. Stand-alone, the Flash file works fine but my application allows only one button click to invoke an action. After that, the buttons become useless.
I was told this is an unresolved VB bug and should add the following VBScript code in my web browser:
sub fs_fscommand(ByVal command, ByVal args)
Call fs_doFSCommand(command, agrs)
End Sub
Where would I insert this and does the script need further editing for my specific application?
Any light shed on this problem would be greatly appreciated.
Mike
|
|
|
|
|
can anyone tell me how to refresh crystal report...after designing it and run it..i realise that if i make any changes to it ...it doesn't show on it the next time i run it..it remains the same.. how do i make the update show?
Nab
|
|
|
|
|
have tried all the sample in the vb.net help file on printing on a custom paper size using crystal reports any help will be appreciated
jacks
|
|
|
|
|
I have created a "Mainform" with the IsMdiContainer Property set to true using VB.Net.
I have created a child form in the same project. I can get forms to load in the child form only if they are included in the mainform project.
I want to know how to load a dll into the child form.
I want to create many different Dll's (Projects) that reference the mainform functionality and then load these dll's into the child form.
IE: "Part Master" , "Employee Master", "Reports" etc.
All of these will be seperate projects so that i can work on a specific area without having to work on one huge project.
I have searched every place i can think of for the last 2 days and cannot find any help or code samples.
Any help or information will be great!
|
|
|
|
|
This I think is a simple question.
When I try and run this piece of code
For Each Dir As String In My.Computer.FileSystem.GetDirectories (DriveComboBox.SelectedItem, FileIO.SearchOption.SearchTopLevelOnly)
FolderListBox.Items.Add(Dir)
Next
When it gets compiled the messages
Name 'FileIO' is not declared
Name 'My' is not declared
I am using Visual Studio 2003.
What imports should I copy in or is there another way of getting these values.
|
|
|
|
|
The My and FileIO namespaces are only in VS2005.
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
Hi,
I am opening a microsoft word document template from vb.net application and filling required fields. I want to capture the updated data when user close the document as i need to save content into database not as word document file.
Regards
Nas
|
|
|
|
|
how do i get hold of a dll or otherwise write code that will give me a floating toolbar that launches each time IE is opened
the floating toolbar , will , say have three buttons on it, each linked to a different URL,
say google, yahoo, and msn.com
any answers / ideas!!!!!!!!!!!! help!!!!!!!!!!!!!!!!!!!!
|
|
|
|
|
Sir,
I am developing an application in ASP.NET.It's using a MS-Access database and I am listing ten Emp_IDs from the table Employee to DropdownList.I want to select particular Emp_Name from Employee table on click on DropdownList. Pleas help me to solve this problem.
Praveen.K
System Engineer
Graviton Technologies Pvt.Ltd
|
|
|
|
|
Hi Praveen,
You are actually asking the wrong people, this being the Visual Basic / VB.NET Q&A. But as the languages are similar, I suggest trying something like:
<br />
Dim Emp_ID as string<br />
Dim MySqlSentence as string<br />
Emp_ID = DropdownList.SelectedItem<br />
MySqlSentence = "SELECT Emp_Name FROM Employee_table WHERE Emp_ID = " & Emp_ID<br />
Good luck,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
OleDbDataAdapter1.SelectCommand.CommandText = "select AID,name from Admin ORDER BY [AID]"
OleDbDataAdapter1.Fill(DataSet21, "Admin")
ComboBox1.DataSource = DataSet21.Tables("Admin")
ComboBox1.DisplayMember = "name"
ComboBox1.ValueMember = "AID"
Ahmed El-Badry
|
|
|
|
|
In VB2005, most of the events pass the sender object as a parameter through the vent itself:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click<br />
Is there any way to get the object's name (not the type) of the sender? .ToString returns its type and I'm looking for a way to get "Button1".
I want to handle the xxxx_Click event for several buttons in the same event and without adding a new parameter with an id or something like that.
Thanks in advance,
Marc Soleda
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
you can use :
if ctype(sender,button).name="Button1" then
'do a task
end if
|
|
|
|
|
Or better yet, cast to Control, which has that property and is more 'guarenteed'.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Ok, that's right for a control but, if it isn't, and it's an object instanciated from a class library that after doing this cast doesn't have the Name property, how could I know it?
Thanks,
Marc Soleda
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
I think you know that the answer to your question is NO, not by the way already mentioned; however, what I understood you are saying is, in general, all objects will have some name, how can you get access to that name?
If that is the question, then I think that the only way is to check for the object type and access its name by the method appropriate to that object type.
for e.g., maybe you need to use reflection to get the class name OR
you can get the type name which should be the class name - I am not sure. Just my thoughts.
Shreekar
|
|
|
|
|
Using reflection I just can get the class name/type. What I'm looking for is its name that, even it's not a control, I have instanciated an object as a class type and with a name. Isn't there any way to retrieve it?
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
Marc Soleda wrote: Using reflection I just can get the class name/type
No, using reflection you can find properties and you can get their values.
Marc Soleda wrote: I have instanciated an object as a class type and with a name.
If you mean the variable name, you can't get it. If you mean a property on the control, you can get it with reflection, but if you don't know what the variable name is, then you're going to have a hard time.
An event handler is always going to have a control come in, I assume you mean the question more generally. It's unusual for your code to take an object and for you to have *no* idea what the object will be.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Christian Graus wrote: An event handler is always going to have a control come in...
Not always if it's an object's class - not a control - that raises an event when a something happens: I file has been received, ...
Christian Graus wrote:
It's unusual for your code to take an object and for you to have *no* idea what the object will be.
Unusual maybe but If I handle an event from several objects in only one eventhandler, then I need to differenciate between them to know which one has been.
At last, I've solved by using Object.ReferenceEquals that determines if two objects are the same instance.
Thanks,
Marc Soleda
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
Try
If sender.name="A Name" Then
'Do A Task
End If
Catch ex As Exception
MsgBox("The object dosn't support name property")
End Try
|
|
|
|