|
Interesting... well the bubble sort is not part of the assignment. She just gave us that. It just says to "Sort" it. To be honest.. I'll have to read more on the IComparer because I don't fully understand it.
|
|
|
|
|
Hi,
a class implementing IComparer basically says Ï have a method Compare() that knows what the relative order would be of two objects of a given type; it will return zero when order is irrelevant (i.e. both objects are equal), a negative value if object1 should preceed object2, and a non-zero positive one if object1 should follow objects2."
So basically an integer Compare() method could just return the difference of both numbers; and a simple string compare method is obviously available in the string class.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hi
I'm writing a program that has a ListBox control. If the user drags a file and drops it on the listbox, the filename should be added to the list. I'm using the following code:
Private Sub ListBox1_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles ListBox1.DragEnter
If e.Data.GetDataPresent(DataFormats.FileDrop) Then
e.Effect = DragDropEffects.Copy
Else
e.Effect = DragDropEffects.None
End If
End Sub
Private Sub ListBox1_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles ListBox1.DragDrop
Stop 'This is called
Dim s$ = e.Data.GetData(DataFormats.FileDrop, True) 'Why does this exit the sub?
Stop 'This not
'...
End Sub
As you can see, I put 2 stop statements in the DragDrop event. The first of them is called and stops debugging, but then e.data.getdata somehow exits the sub, and so nothing happens.
Is it even possible that a procedure exits the sub it is called from (without exiting the thread)???
I'm very confused ; I would be grateful to anyone who could give me an explanation for this.
|
|
|
|
|
What on earth is a stop statement - never used one never even heard of one.
Why not just use a breakpoint and inspect the content of e.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I'm glad you made that reply. I was going to say exactly the same, but as I do not do much VB it might have passed me by and I didn't want to appear dumb.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Yeah, just got into the office and about to fire up VB/MSDN to find out what. I used VB since the early 90's (I now use C#) and have never used a stop statement.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
The FileDrop data format is a StringCollection so there should be a runtime error when you try to assign into the string s$.
The question is why do you not see the exception?
Do you have ON ERROR GOTO 0 anywhere in your code?
Alan.
|
|
|
|
|
Hi,
If there was any On Error or Try statement in my code I would understand, but there isn't!
Yes, with a string array it works . Tnx
|
|
|
|
|
Hello,
Iam working on vb.net2008 and using Access as backend.
1) I want my database should save on default location unlike this:
Dim connectionstring As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Contacts3\mycontacts.mdb;Persist Security Info=False"
Since i'm deploying my project on another computer itz showing me an error of database connection.Then again i've to make one folder of Contacts3 in C drive and then itz connecting the database.please let me know how can i deploy my database as default.
Thanks
Mirza
modified on Sunday, July 5, 2009 6:17 AM
|
|
|
|
|
Add a custom folder in your setup project and place your MDB file in it. Set the target loaction of the folder as you need.
|
|
|
|
|
Thanks danish for your reply.Danish i want my database should be in my project folder and dont want to place my access db manually to the specified path.I want something like this:
Dim connectionstring As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\mycontacts.mdb;Persist Security Info=False"
Here i'm not putting the location i.e, C:\Contacts3.This'll store my records wherver mycontacts.mdb file present.I think i'm missing somthing before this ?????\mycontacts.mdb and in project->windowsproperties->setting->value i should put & or + before \mycontacts.mdb
Thanks
|
|
|
|
|
Path.GetFullPath will give you that I guess. Is that the path you are looking for?
|
|
|
|
|
best apply your path in dynamically.
Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
Mail To : foreverkans@gmail.com
|
|
|
|
|
Yes Mr. Kannan exactly i want my path dynamically but dont know where i am goin wrong..
plz suggest me.
Dim connectionstring As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Contacts3\mycontacts.mdb;Persist Security Info=False"
Thanks
|
|
|
|
|
Dear Danish,
Actually i just need to know what should i write before \mycontacts.mdb instead of C:\(database drive path) because if i mentioned the path then i've to put the same folder(in order to get the same path)in other system where i'll deploy my project(client).
i think i should write & before my database like &\mycontacts.mdb but still i'm not sure.
Once again Thanks
|
|
|
|
|
Hi all...
I want to know that how can I add different effects like - sepia,mono,negative etc. in an Image through programming. I am using VS with vb.net.
Also tell me what is the procedure to create a cartoon image from an existing image.
Thanks.
Gagan
|
|
|
|
|
Is ImageMagick something for you? (just google it) It has huge options to do things with images programmaticly...
Rozis
|
|
|
|
|
First question - I have some articles on image filters with C#, you can compile those to a dll and use in VB.
Second - a cartoon filter is not a simple one step process, a forum reply is not going to answer that.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Thanks for your reply.
So can you tell me that where can I download your articles on image filters so that I can use it in my project.
And also suggest me how can I create a cartoon from an image or where can I get these things.
Thanks
Gagan
|
|
|
|
|
OK. Well, the articles are here on code project, so search the site for them. The cartoon, to be honest, I don't know off the top of my head, except that I'd expect you'd use smoothing to get a photo to look more like a drawing. Beyond that, I'd look for SIGRAPH papers or other sources with google and expect to find algorithms that I needed to turn in to code.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Ok.
Thanks man for your suggestion and for your help
carry on.
Gagan
|
|
|
|
|
hello !
can u tell me what is Using keyword in VB.net ? what it do ? and if i want to write a keyword like this in C#, which keyword should i use ?
|
|
|
|
|
The Using keyword simply sticks a Dispose call at the end of the code. For example:
Using(sw As New StreamWriter("C:/TestFile.txt"))
sw.WriteLine("Aloha!")
End Using
becomes
Try
Dim sw As New StreamWriter("C:/TestFile.txt")
sw.WriteLine("Aloha!")
Finally
sw.Dispose()
End Try
The keyword in C# is using ; it's case sensitive, unlike VB.Net
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
It does more for you than just call Dispose in the manner in which you describe.
It also wraps it in a Try /Finally block too so that Dispose is always called even in the event that an exception is raised. This is where its real usefulness lies. It is much easier to write the Using block that it would two write all the corresponsing Try /Finally stuff to do the same thing.
|
|
|
|
|
Ah, I didn't know that. Thanks for the update; I've updated my example code to take that into account
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|