|
I have a listview on my form whereas my form is the child window of microsoft visio Application. I want to drag image from my listview and drop in visio drawing.
The problem is that how we track the mouse up events in visio because mouseup event does not fire without mousedown event. and my mouse down events fired on my form.
Plase help if someone have idea about that!
Thanks
Thanks
|
|
|
|
|
Sorry if this is elsewhere but I look and could not find.
Can I / How do I create an arrarylist of an object.
For instance for the below object
Public Class Posts
Public Name As String
Public ID As Integer
Public Selected As Boolean
End Class
Cheers
Geoff
|
|
|
|
|
Add a method that creates the ArrayList:
Public Class Posts
Public Name As String
Public ID As Integer
Public Selected As Boolean
Public Function MakeList() as ArrayList
Dim list as New ArrayList();
list.Add(Name);
list.Add(ID);
list.Add(Selected);
Return list;
End Function
End Class
I don't really know if this is the solution you want, as you haven't told anything about what you are trying to accomplish. If it's not, you have to surrender a bit more information...
---
Year happy = new Year(2007);
|
|
|
|
|
Sorry I was not tring to be difficult,
This looks like what I am after I want to create an arrary of the Posts objects (only using this as an example) and the dynamically add to the arrarylist.
How would I use the above to create the list of object and add to them.
Thanks I am strating to see the answer
|
|
|
|
|
Public Class Posts
Public Name As String
Public ID As Integer
Public Selected As Boolean
End Class
dim oArr as new arraylist
------Populate the arraylist ------
dim oPost as new Posts
oPost.Name = "me"
oPost.ID = 1
oPost.Selected=False
oArr.Add (oPost)
oPost = Nothing
oPost = new Posts
oPost.Name = "you"
oPost.ID = 2
oPost.Selected=true
oArr.Add (oPost)
oPost = Nothing
.
.
.
------example to get values out ------
For Each oPost in oArr
Msgbox(oPost.name)
Next
|
|
|
|
|
Aah Clear concise and I even understand
Many Thanks will give it a go.
Cheers
|
|
|
|
|
Ok, Iam stuck again I cobbled together a sort metod in by posts class (see below). When I run the code it works ok if my posts have names C,B, and A but if they have C, B and C no sorting occurs. Any Body got any clues pls
Public Class Form1<br />
Inherits System.Windows.Forms.Form<br />
<br />
Public Class Posts<br />
Implements IComparable<br />
<br />
Public Name As String<br />
Public ID As Integer<br />
Public Selected As Boolean<br />
<br />
Public Function CompareTo(ByVal obj As Object) As Integer Implements System.IComparable.CompareTo<br />
<br />
Dim temp As Posts = CType(obj, Posts)<br />
Dim vMe As String = Name<br />
Dim iMe As Integer = ID<br />
Dim mestxt<br />
<br />
mestxt = "Name=" & vMe & ", Id=" & ID & " Temp name=" & temp.Name & " Temp_ID=" & temp.ID<br />
MessageBox.Show(mestxt, "Compare")<br />
<br />
If vMe < temp.Name Then<br />
MessageBox.Show("1")<br />
Return 1<br />
End If<br />
<br />
If vMe > temp.Name Then<br />
Return 0<br />
End If<br />
<br />
End Function<br />
<br />
End Class<br />
<br />
<br />
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
Dim oArr As New ArrayList<br />
Dim mestxt As String<br />
<br />
<br />
Dim oPost As New Posts<br />
oPost.Name = "C"<br />
oPost.ID = 1<br />
oPost.Selected = False<br />
oArr.Add(oPost)<br />
oPost = Nothing<br />
<br />
oPost = New Posts<br />
oPost.Name = "B"<br />
oPost.ID = 2<br />
oPost.Selected = True<br />
oArr.Add(oPost)<br />
oPost = Nothing<br />
<br />
oPost = New Posts<br />
oPost.Name = "C"<br />
oPost.ID = 3<br />
oPost.Selected = True<br />
oArr.Add(oPost)<br />
oPost = Nothing<br />
<br />
mestxt = "Original -> "<br />
For Each oPost In oArr<br />
mestxt = mestxt + oPost.Name & ", "<br />
Next<br />
MessageBox.Show(mestxt)<br />
<br />
oArr.Sort()<br />
oPost = Nothing<br />
oPost = New Posts<br />
<br />
mestxt = mestxt & "Sorted -> "<br />
For Each oPost In oArr<br />
mestxt = mestxt + oPost.Name & ", "<br />
Next<br />
MessageBox.Show(mestxt)<br />
<br />
End Sub<br />
End Class
|
|
|
|
|
Thanks That works fine.
The bit I was having trouble with was I thought you had to link the obeject to the arraylist somehow. I see now that arrarylist will allow you to add to it with whatever you like there is no need to "preset" it to do so.
Thanks again
|
|
|
|
|
Hey I solved my own question.
The problem with my code was I was returning 1 for greater than an zero for <= .
The compare function should return 1 for greater than 0 for equal to and -1 for less than. Phew on to the next stage.
Public Class Posts<br />
Implements IComparable<br />
Public Name As String<br />
Public ID As Integer<br />
Public Selected As Boolean<br />
<br />
Public Function CompareTo(ByVal obj As Object) As Integer Implements System.IComparable.CompareTo<br />
Dim temp As Posts = CType(obj, Posts)<br />
Dim mestxt<br />
<br />
If Name > temp.Name Then<br />
Return 1<br />
ElseIf Name = temp.Name Then<br />
Return 0<br />
Else<br />
Return -1<br />
End If<br />
<br />
End Function<br />
<br />
End Class
|
|
|
|
|
Hi,
I have list of Files and Folders containg files in a Directory.
Can anybody say how to bind the names of the folders,files in that
folder in datagrid.
|
|
|
|
|
hi,
im trying to print a barcode on my report using vb6 printer object but i dont have a clue of how to go about doing this,
Pls help
Thabang
im a junior developer at a company called securemail in south africa
|
|
|
|
|
You ca use the Line method, there are examples in MSDN.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
how do i authenticate any email address i accept from a form in vb.net?
im not talking about regex authentication,i mean how can i verify if it is an actual existing address?
ik pair past mein,te dooja pair future mein.tabhi to aaj pe moot rahe hain.
|
|
|
|
|
the.bombardier wrote: i mean how can i verify if it is an actual existing address?
The only way to do that is to send an email to the address with a link, coded specially for that address, to a website that the user has to click on. The web application that takes the data in the URL and uses it to figure out which address that is the one that clicked on the link. It's impossible to do it in an automated way. If there was a way to do it, we'd all have thousands of times more spam in our email boxes!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hello everybody
I want to know that what are the different types of client server architecture ?
What is file server architecture and client server architecture ?
Examples of different databases that are of either type and what is the difference between file server and client server architecture ?
|
|
|
|
|
wrote: I want to know that what are the different types of client server architecture ?
I don't really know what you mean by that. There is only one architecture. You have a server and you have one or many clients that connect to the server.
wrote: What is file server architecture
It is a form of client server that serves files to clients.
wrote: Examples of different databases that are of either type
A database is a form of client server. You have a database server (e.g. SQL Server) and you have clients that connect to the database.
|
|
|
|
|
Can i debug a program from Program Debug Database (PDB) file, without open project in source code ? What is the usage of this file? If yes, How to do that ?
Thanks in advanced for all the replies!
|
|
|
|
|
If the .pdb is in the same location as the executable and start it with the dbgclr.exe debugger it will use it...
|
|
|
|
|
I have an application which automatically opens every 1 hour for all system in the LAN.
In that application,i have a button like "Select". who click the select button first, the application will continue running on that system and others systems i want to close the application.
if it is possible in multicasting, plz tell me
Please give help how to do, and if u have any link plz give me.
Thanks & Regards
Kumaran
|
|
|
|
|
i want to change the cellwidth of all the columns in a table in a dataset. records are taken from database and using adapter i am filling the records to dataset and i am assigning that dataset to datagrid.but i want to make some columns bigger in datagrid .how can i make that
|
|
|
|
|
Give the grid the dataset then use the grid to change the properties...
grd.columns("TStamp").width = 200 'width of column
grd.columns("TStamp").headertext="Time Stamp" 'column header
etc
|
|
|
|
|
I have a form that is opened from several different places and with different code in form.load depending on which form opened it. How can I tell which form or 'Parent' form opened the 'child' form? Thanks in advance.
|
|
|
|
|
You can add a "parent" field and property to the child form. When the "parent" is about to open it it sets the property.
Alternatively, you could provide a constructor that accepts the parent form as a parameter. It can then store the information in a field
|
|
|
|
|
Thanks for the answer, but I don't understand what you mean by 'field'. I'm having problems with;
If Childform.parent = formParent then
' my code here
End If
does this make sense?
Thanks
|
|
|
|
|
sdkgolf wrote: I don't understand what you mean by 'field'.
It used to be known as a "member variable" in C++.
|
|
|
|