|
I don't know what that means. A usercontrol, by default is able to contain other controls. I've not used VB6.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Sorry, in VB2005, an usercontrol is'nt containar preliminary.You should do that yourself. But I dont know how?
Thanks.
Mansour
|
|
|
|
|
|
Not sure if this is a VS.Net bug or if I am doing something wrong. I have a listview which has some items in it. The listview has checkboxes so when the user checks an item I am using this event to get the item:
Private Sub ListView1_ItemCheck(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemCheckEventArgs) Handles ListView1.ItemCheck
Dim item As ListViewItem
Dim Selection As ListView.CheckedListViewItemCollection = ListView1.CheckedItems
For Each item In Selection
Dim itm As String = item.Text
TextBox1.Text = itm
Next
End Sub
The problem is when the checkbox is checked the collection has no items but when unchecked then it has an item in it.
Am I doing something wrong? I also tried the mouse up and mouse down event to check the collection but yields the same behavior.
Any ideas?
Yoshimitsu
|
|
|
|
|
Change the ListView1.ItemCheck to ListView1.ItemChecked .
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
I get a compilation error as that event does not exist. I even checked all the events for the control and it does not have ItemChecked event.
Yoshimitsu
|
|
|
|
|
The checked event wasn't added until .net 2.0. The item's checked state doesn't get updated until after the check event gets raised. Therefore the items in the checked collection (during the check event) do not accuratly portray the state of the listview. The newest item will not be included if it's being checked and will be included when it's being unchecked. The good news is there is a pretty simple workaround. Here's how you can do it.
Private Sub ListView1_ItemCheck(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemCheckEventArgs) Handles ListView1.ItemCheck
'Check new value of item that called this event. If checked display in console.
If e.NewValue = CheckState.Checked Then Console.WriteLine(ListView1.Items(e.Index).Text)
'Display each checked item in the console window
For Each item As ListViewItem In ListView1.CheckedItems
'If item is same as item that called this event then ignore it
If item.Index = e.Index Then Continue For
Console.WriteLine(item.Text)
Next
End Sub
|
|
|
|
|
I noticed you are trying to loop through all the checkeditems. There may be more then just one. If you want to show only the item that was just checked then you should using something like this.
Private Sub ListView1_ItemCheck(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemCheckEventArgs) Handles ListView1.ItemCheck
If e.NewValue = CheckState.Checked Then TextBox1.Text = ListView1.Items(e.Index).Text
End Sub
However, if you want to display all the checked items, which is what you appear to want, you'll need to do it differently. The way you have it set up will only display the last item that was found in the CheckedItems collection.
|
|
|
|
|
Thanks TwoFaced
|
|
|
|
|
I can get the assembly and see the types from within it. But I'm missing the link to see the members of the class. Could someone guide me please?
Dim asm = [Assembly].LoadFrom("stta.dll")
Dim ty As Type = asm.CSPluginClass
Dim Memberinforms() As MemberInfo = Type.GetType(????).GetMembers
What goes where ???? is?
Why not ty?
thanks!
|
|
|
|
|
|
OK, sorry to be stupid. I've read a lot of documentation, but I'm missing this.
My main program needs to find an assembly. The assembly will have one class, and it will have known properties and methods within it.
What is not known ahead of time is the name of the class.
My question is how to call the methods within the class. Presumably I need to get the name of the class somehow.
thanks
|
|
|
|
|
OK, got it... in case it might help anyone
Dim Asm = System.Reflection.Assembly.LoadFrom "myassembly.dll")
'Since there's only one Exported class
Dim ty As Type = Asm.GetExportedTypes(0)
Dim CSPluginClass As Object = Asm.CreateInstance(ty.FullName, True)
Thanks all!
|
|
|
|
|
Hi Guys ,
I am running two applications one of VB6.0 and other with .Net 2005.
When accessing crystal report 9.2 through VB 6.0 application it generates an error.
I tried same VB 6.0 application on other computer without .Net application then it doesn't generate any error.
Kindly send me your suggestions
Thanks in advance.
|
|
|
|
|
What is the error message?
t.aransiola
|
|
|
|
|
hi everyone,
please tell me wht shuld i do?
i m developing application in vb.net(winforms)
On my edit button i want to fill datagridview from taking all records in data,
but when i m going to insert data into combobox it will give me handle dataerror Event.
i wrote following code on Edit button click.
cmd = New MySqlCommand("SELECT t.ID, t.CustID, Project, Task, t.Monday, t.Tuesday, t.Wednesday, t.Thursday, " & _
" t.Friday, t.Total , c.CustName FROM timesheet_details t, cust_mast c WHERE c.CustID = t.CustID " & _
" and id=" & txtID.Text & ";", conn)
reader = cmd.ExecuteReader()
i = 0
Dim j As Integer
j = 0
Do While reader.Read()
j += 1
Loop
reader.Close()
DGTimeSheet.Columns.Clear()
DGTimeSheet.ColumnCount = 6
DGTimeSheet_Design()
DGTimeSheet.RowCount = j
reader = cmd.ExecuteReader()
While reader.Read()
MsgBox(reader(2))
MsgBox(reader(3))
CmbCellProj.AutoComplete = True
DGTimeSheet..Item(1, i).Value= CStr(reader(3)) ''Task
DGTimeSheet.Item(1, i).Value = reader(1) ''Project
DGTimeSheet.Item(3, i).Value = reader(4)
DGTimeSheet.Item(4, i).Value = reader(5)
DGTimeSheet.Item(5, i).Value = reader(6)
DGTimeSheet.Item(6, i).Value = reader(7)
DGTimeSheet.Item(7, i).Value = reader(8)
DGTimeSheet.Item(8, i).Value = reader(9) ''Total
DGTimeSheet.Item(0, i).Value = reader(10) ''CustName
''DGTimeSheet.Item(1, i).Selected = True
DGTimeSheet.Item(0, 0).Style.DataSourceNullValue = reader(2)
i = i + 1
End While
reader.Close()
--Thanks in advance for help
priya
|
|
|
|
|
I assume that this is just your test code, and that you will not ship code that is totally open to SQL injections.
Why are you fetching the data twice? If you need it more than once, fetch into a DataSet or something. Then you don't have to loop through the records to find out how many there are either.
I can't see any code where you try to insert data in any combobox. If you want any help with your error, you have to show the code where it does occur, not some completely different code.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi,
I need to get the name of an instance of class. Perhaps, using reflection?
Below i show the example
class Idle<br />
Public one as int32<br />
end class<br />
<br />
class form1<br />
Dim MyIdle as new Idle<br />
public Sub button1_click(sender,...) handles button1.click<br />
textbox1.text= ?¿<br />
end Sub<br />
end class
How can i get the name 'MyIdle' ??
|
|
|
|
|
hi!
you can't get the variable name. With Reflection you can get types of assemblies, for example. but a variable name is not metadata in a compiled assembly, because a variable is only a location in the ram.
solidIT.de - under construction
Components for Microsoft .Net
audittrail, objectcomparer, deepcopy and much more ...
|
|
|
|
|
Hi 2 All,
Please suggest me,how can insert a ocx control in word document?
Thanks
Arun Kumar
Soft Engg - DOTNET
Arun Kr
|
|
|
|
|
Hi,
I have a page which has Labels and Textboxes. Those textboxes contain data which is coming from a database. I want to be able to export the data in the textboxes into excel. Is there anyway for doing that? Do you know of any site which shows me how to?
Thanks!
|
|
|
|
|
you can use componentOne's tools or either use excel.dll for that.
Lxcite's Planet
... the ultimate solution
|
|
|
|
|
hi,
if you do not need any formatting in your destination excel file you can create a simple text file with the extension xls. you only have to seperate your content throug vbTab and vbNewLine.
solidIT.de - under construction
Components for Microsoft .Net
audittrail, objectcomparer, deepcopy and much more ...
|
|
|
|
|
Hi ,
I am using a property grid to show some controls property and dynamically set them.I want to remove some property or customized some choosed property .How can I do this.Please help me.It is urgent.
thanks in Advance
Sandy
|
|
|
|
|
Don't. Cross. Post.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|