Click here to Skip to main content
11,502,503 members (37,048 online)

Comments by Ravi Bhavnani (Top 200 by date)

Ravi Bhavnani at 26-May-15 11:32am View
If you want to know the cursor position at all times (regardless of over which Control or Form the cursor may or may not be), simply check Cursor.Position in a timer tick handler. The timer can be a child of your app's main Form.

Ravi Bhavnani at 25-May-15 10:51am View
What's your question? We're not here to do your homework.

Ravi Bhavnani at 21-May-15 10:38am View
What is a "panel" node? What technology are you using? WPF? Silverlight? WinForms? Web?

Ravi Bhavnani at 15-May-15 14:20pm View


Ravi Bhavnani at 23-Apr-15 8:41am View
> I am trying to code this in C#.Net but did't get success yet,
That's extremely vague. What do you mean by "didn't get success yet"? You need to be specific when seeking assistance. Also, show the code you've tried.

Try the accepted answer on this SO page and see if that helps:

Ravi Bhavnani at 21-Apr-15 7:51am View
Absolutely. My 5 was for the link to more details about the aspect of audio.

Ravi Bhavnani at 20-Apr-15 20:03pm View
Good point - 5'd back! :)

Ravi Bhavnani at 8-Apr-15 10:33am View
> i don't want unnecessary files.

Filter the notifications. See

Ravi Bhavnani at 6-Apr-15 14:02pm View

Ravi Bhavnani at 6-Apr-15 13:54pm View
Hi SA,

By "C# binding" I meant Xamarin offers C# bindings to the Android SDK and allows C# code (e.g. developer defined callbacks) to be invoked by Android callable wrappers. Is this not true?

Ravi Bhavnani at 6-Apr-15 12:49pm View
Please see this cool free book on Xamarin Forms by Petzold.

Ravi Bhavnani at 6-Apr-15 12:47pm View
Xamarin generates IL which is packaged in the .apk (in the case of Android) and runs on top off Mono. The process of converting IL to a form consumable by Dalvik (and the newer Android VM) is transparent. For all practical purposes, the .apk generated by Xamarin is no different than one generated when building a native app.

IMHO, the nice thing about Xamarin is that it allows me to leverage my C# skills and the .NET framework. Caveat: I still need to know the Android API (which is not hard to pick up) in order to build Android apps. The same applies for iOS.

Edit: Xamarin Forms controls translate to native controls.

Ravi Bhavnani at 6-Apr-15 12:16pm View
> Can i write once in Xamarin GUI and run on all 4 platforms including Windows desktop?
No.  Windows desktop (WinForms/WPF) is not supported.

Essentially, only UI code written using Xamarin Forms is portable across iOS, Android and Windows Mobile.

Ravi Bhavnani at 6-Apr-15 12:14pm View
1) Correct.  PCLs are used to build shared business logic.

2) No, everything written in Xamarin is NOT cross platform! Xamarin.IOS is the C# binding to iOS.  Xamarin.Android is the C# binding to Android.  This allows you to access the standard iOS and Android APIs from C#.

Ravi Bhavnani at 27-Mar-15 8:39am View
I use AMFI, MoneyControl and ValueResearchOnline as my sources in this app:

Ravi Bhavnani at 7-Mar-15 20:22pm View
Sorry, we're not mind readers. We have no idea what you mean by "this program".

And even if we did, do you seriously expect someone to make a video tutorial for you?

Ravi Bhavnani at 3-Mar-15 14:50pm View
See this SO link:

Ravi Bhavnani at 3-Mar-15 14:49pm View
It may be a WCF issue. Try setting "maxReceivedMessageSize" to a larger value.

Ravi Bhavnani at 2-Mar-15 10:13am View
Yes. It works with .NET 3.5 (and possibly older versions).

Ravi Bhavnani at 25-Feb-15 12:48pm View
Does the answer on this SO page help?

Ravi Bhavnani at 25-Feb-15 12:12pm View
Thanks for the correction, SA. +5d.

Ravi Bhavnani at 25-Feb-15 11:09am View
I suspect your math may not be correct.

Ravi Bhavnani at 18-Feb-15 12:32pm View
You're right, SA. I tagged the question appropriately to help future readers.

Ravi Bhavnani at 18-Feb-15 12:09pm View
A ComboBox has 3 diaplay modes - one of them resembles an always open list. Maybe that would suit your needs better?

Ravi Bhavnani at 18-Feb-15 11:16am View
> it was not taught to us
That's a terrible attitude. Google it. You won't get far developing software if you don't research and experiment.

Ravi Bhavnani at 18-Feb-15 11:06am View
>You will never succeed sending SMS using SMTP.
Unless you use an email to SMS service. :)

Ravi Bhavnani at 18-Feb-15 10:50am View
What platform? Web? Desktop (WinForms/WPF)? Silverlight?

Ravi Bhavnani at 13-Feb-15 23:31pm View
> How do I write these codes
By opening a book on Java and studying it. And BTW, it's "code", not "codes".

Ravi Bhavnani at 10-Feb-15 14:11pm View
You have several options.  For starters, see this list of articles.

Ravi Bhavnani at 10-Feb-15 12:32pm View
It's impossible to answer your question without more detail.

Ravi Bhavnani at 8-Feb-15 11:22am View
Sorry, but I find that hard to believe. How would a website be able to check if an email address is indeed valid?

Ravi Bhavnani at 5-Feb-15 17:59pm View
Check out Firebase @

Ravi Bhavnani at 5-Feb-15 17:59pm View
SA, check out (Apologies if you already know about this). I know you're not the OP but thought it might interest you. I'm planning to build a demo and maybe publish it @ CP.


Ravi Bhavnani at 5-Feb-15 11:38am View
I expect the Android and Windows Forms apps will both need to communicate with a common server or at the very least, a networked file store that's accessible to both clients. The file store is an error prone and cheesy solution.

Ravi Bhavnani at 3-Feb-15 23:58pm View
What have you tried and where exactly are you stuck?

Ravi Bhavnani at 30-Jan-15 23:07pm View
Post your program's code so I can see where you've gone wrong.

Ravi Bhavnani at 30-Jan-15 22:20pm View
What have you tried and where are you having a problem?

Ravi Bhavnani at 28-Jan-15 18:27pm View
You're welcome! :)

Ravi Bhavnani at 24-Jan-15 0:40am View
Patrick, you may want to consider using Xamarin Indie edition with Xamarin Studio (instead of VStudio). That's the path I'm likely to follow once I restart working with Xamarin. Like you, I'm interested in Android dev only.

Ravi Bhavnani at 24-Jan-15 0:36am View
OG, why use Java when you have a more powerful and elegant language (C#) at your disposal? Use Xamarin Studio (instead of VS) with the Indie license. IMHO, that beats going through the hassle of using and configuring Android Studio or Eclipse and settling for an inferior language.

Ravi Bhavnani at 14-Jan-15 12:05pm View
My point is, once an image file has been shown in a PictureBox, the file is locked until the PictureBox is garbage collected (e.g. when your app exits). If you use the suggestion in the link (the link works fine) your file will not be locked. This will allow it to be moved/deleted/renamed.

Ravi Bhavnani at 14-Jan-15 10:27am View
The Reports table will have columns:
- ReportId (identity)
- ReportingUserId (FK to User.UserId)
- TargetUserId (FK to User.UserId)
- ReportText (not null)
- TimeCreated

This will let you query the Reports table for reports by/for a specific user and/or reports issued within a certain time frame and/or reports containing specific text.

Ravi Bhavnani at 14-Jan-15 9:08am View
No apology needed. We're here to help (if we can).


Ravi Bhavnani at 6-Jan-15 20:55pm View
Email me:
(1) a screenshot of SMSS showing the column definitions in your table (i.e. column names and their types)
(2) your C# project containing the Windows Forms app

My email address is ravib(at)ravib(dot)com.

Ravi Bhavnani at 6-Jan-15 20:20pm View
Your INSERT statement implies the columns in your table are NAME and PICTURE, but your SELECT statement refers to the column ID. Of them seems incorrect. Fix and retry.

Ravi Bhavnani at 6-Jan-15 20:07pm View
I apologize. I was thinking ListView, not ListBox. Sorry.

SelectedItem.ToString() will work if the items in the list box are strings and the string is the format of the picture index (e.g. an integer). It should also work if the ListBox contains integers.

Please confirm this is the case and retry.

Ravi Bhavnani at 6-Jan-15 19:51pm View
I'm not surprised. Your query is wrong. Look at my answer again.

Ravi Bhavnani at 5-Jan-15 23:51pm View
What have you tried?

Ravi Bhavnani at 1-Jan-15 20:32pm View
"its not working"
That doesn't tell me anything.

What happens when you debug the app? Is the query correct? Is the item not found in the database? Is there an exception thrown?

Ravi Bhavnani at 31-Dec-14 9:54am View
Gracias, mon ami. And a very happy New Year!

Ravi Bhavnani at 30-Dec-14 17:55pm View
Try setting pdfWriter.CloseStream to false. It may be conflicting with the close that will occur when the FileStream fs goes out of scope.

Ravi Bhavnani at 21-Dec-14 15:58pm View
I'm pretty sure Kornfeld is right. See this SO question:

Ravi Bhavnani at 21-Dec-14 13:42pm View
> How can I do this, independent of programs platform(32b or 64b) that are running?

See the 2nd answer to this SO question:

Ravi Bhavnani at 17-Dec-14 20:42pm View
Can you assume (or can you require) that Excel is installed on the machine on which your app runs?

Ravi Bhavnani at 16-Dec-14 15:38pm View
You may want to check out my DomainWalker example as a starting point - see

Ravi Bhavnani at 4-Dec-14 22:52pm View
Thank you, Bill-ji!

Ravi Bhavnani at 4-Dec-14 18:23pm View
Thanks, SA!

Ravi Bhavnani at 4-Dec-14 12:14pm View
Thank you, sir!

Ravi Bhavnani at 2-Dec-14 13:12pm View
Because there are 60 (not 100) minutes in an hour. So 15.15 hours is 15hr:09mins not 15hr:15 mins.

Ravi Bhavnani at 2-Dec-14 12:21pm View
See my solution.

Ravi Bhavnani at 2-Dec-14 12:17pm View
Wrong again. 15.35 hrs + 15.35 hrs = 30.70 hrs, or 30 hrs and 42 minutes, not 31 hrs and 10 minutes.

Ravi Bhavnani at 2-Dec-14 12:04pm View
I don't understand your question. 198.70 hours is 198 hrs and 42 minutes, not 198 hours and 10 minutes.

Ravi Bhavnani at 28-Nov-14 13:21pm View
I've deleted my solution that recommended setting ShowEffects to true as it didn't help. Apologies for the false lead.

Ravi Bhavnani at 20-Nov-14 16:13pm View
Ravi Bhavnani at 20-Nov-14 16:13pm View
Ravi Bhavnani at 20-Nov-14 16:12pm View
Ravi Bhavnani at 28-Oct-14 15:03pm View
> Your wrong assumption is that a and b are zeros.
> This is not true.
> In fact, a and b are either initialized or not.
You're correct - thanks for clearing that up.

Ravi Bhavnani at 28-Oct-14 13:36pm View
You're right, Sergey - the code doesn't compile in its current state.

But IMHO, initializing a and b (to get the code to compile) would not really change the values of c and d, as they would "change" from zero to zero, since declaring an int initializes it to Int32.Default. The optimized version of the compileable code would (IMHO) be an empty statement.

Ravi Bhavnani at 26-Oct-14 12:16pm View
Would you want all the tools in your toolbox to be hammers? The answer to that question is the same as the answer to your question.

Ravi Bhavnani at 24-Sep-14 7:59am View
It's just my coding style to perform explicit initialization, but you're right - it's unnecessary.

Ravi Bhavnani at 23-Sep-14 12:11pm View
SA, I think he wants to go in the reverse direction.

Ravi Bhavnani at 22-Sep-14 14:28pm View
Thanks, Sergey! :)

Ravi Bhavnani at 16-Sep-14 12:34pm View
> how is it possible to create a custom messagebox with desire requirements
See this article:

> can you help plzz..??
No. You will have to do your own work. A simple Google search (which I'm going to assume you didn't bother to do) would have revealed the above link.


Ravi Bhavnani at 16-Sep-14 12:17pm View
Why are you asking the same question again? Did you not see the replies to your original question?

Ravi Bhavnani at 15-Sep-14 15:10pm View
You could use a Stopwatch to time code execution. Although the right way to instrument is to use a profiler.

Ravi Bhavnani at 12-Sep-14 15:52pm View
Please post representative parts of your code.

Ravi Bhavnani at 10-Sep-14 11:16am View
I second Xamarin.

Ravi Bhavnani at 6-Sep-14 14:31pm View
Great. Please mark the solution as accepted so that it's easier for others to find.

Ravi Bhavnani at 6-Sep-14 14:03pm View
See my 2nd solution.

Ravi Bhavnani at 6-Sep-14 13:52pm View
Unformatted code is hard to read. Stay tuned while I post a new solution.

Ravi Bhavnani at 6-Sep-14 13:51pm View
Stay tuned...
Ravi Bhavnani at 6-Sep-14 9:33am View
Does Form1 display Form2?

Ravi Bhavnani at 5-Sep-14 17:01pm View
What do you mean by that?

Ravi Bhavnani at 5-Sep-14 9:55am View
I don't recommend your approach.  By creating a static TextBox, you're declaring a single instance for all instances of Form1, which is clearly incorrect.  Instead, create a TextBox using the toolbox, and follow the instructions in my solution.

To pass a Form1 reference to Form2, do the following:

(1) Add a public Form1 property to Form2.
(2) When you create an instance of Form2 (from Form1), set the value of that property.
(3) Perform step 3 as mentioned in my solution.

If what I've said doesn't make sense, I recommend you read up on the basics of C# and Windows Forms. That will help you implement your requirements.

Ravi Bhavnani at 21-Aug-14 16:22pm View
Oooh this brings back memories of the SCMS feature on my circa 1998 TASCAM DA-20 DAT recorder!

Ravi Bhavnani at 21-Aug-14 16:09pm View
"A hardcore scanner which will track viruses."

That's an extremely vague requirement.

Ravi Bhavnani at 19-Aug-14 16:42pm View
Thanks, Khalid. If you accept the solution, please mark it accepted, making it easier for others to find.

Ravi Bhavnani at 19-Aug-14 16:28pm View
You could just define them as constants. See

Ravi Bhavnani at 18-Aug-14 7:46am View
No, I assumed you would define sndplayer outside the scope of my answer.

The problem is, it's very unlikely that your timer will fire when it's EXACTLY 6:00:00.000 am. For this reason, you should play the sound the first time the time (to the nearest minute only) is 6:00, and then disable the timer.

Ravi Bhavnani at 25-Jul-14 19:26pm View
In that case, you'll need to inspect the JavaScript that's injecting the content (most likely by making an AJAX call) into the page and make that call from your webservice to get that data.

I recommend using Fiddler or Chrome's Developer Tools window (press F12 to show it, then press F5 to reload the page and watch the network traffic).

Ravi Bhavnani at 25-Jul-14 18:47pm View
Not crazy weird. :) It's possible that's being injected into the DOM by JavaScript.

Ravi Bhavnani at 25-Jul-14 18:30pm View
That content should definitely be present in your string, starting at the substring:

<div Style="height:250px; overflow:auto; scrollbar-face-color:blue" >

Ravi Bhavnani at 25-Jul-14 18:19pm View
Remember, you won't be able to download content that's injected into the DOM via JavaScript or by making AJAX requests after the page has loaded, by simply making a call to WebClient.DownloadString().

Ravi Bhavnani at 24-Jul-14 8:23am View
I've updated my solution with a link to a correct implementation.

Ravi Bhavnani at 24-Jul-14 8:16am View
Hi Sergey, no I didn't run the sample project before recommending it as a possible solution. Thanks for the heads up.

Ravi Bhavnani at 23-Jul-14 11:09am View
If you find it useful, please accept and rate the solution. This will make it easier for others to find it. Thanks.

Ravi Bhavnani at 3-Jul-14 12:21pm View
Not sure 'bout that. (It seems too techy for homework). Methinks it's just a coincidence.

Ravi Bhavnani at 3-Jul-14 10:33am View
Seems like a common question today. See

Ravi Bhavnani at 8-May-14 7:49am View
NP - please accept this solution. Thanks,

Ravi Bhavnani at 7-May-14 19:46pm View
Does this article help?

Perhaps if you are able to clearly specify your needs I may be able to help more.

Ravi Bhavnani at 7-May-14 13:27pm View
> My ask is auto size when change size of form. It isn't location

I realize that. Did you care to read the documentation I pointed you to?

Ravi Bhavnani at 1-May-14 7:23am View
In that case, set the form's StartPosition property (in the designer) to CenterScreen.

Ravi Bhavnani at 24-Apr-14 10:28am View
You'd be better off asking this question in the article's forum. That makes it visible to the author of the article.

Ravi Bhavnani at 22-Apr-14 12:18pm View
(1) What does this question have to do with SQL?
(2) Are all periods 45 mins long?
(3) Is the interval between each period always 5 mins?
(4) How many periods exist in a day?

Ravi Bhavnani at 20-Apr-14 13:18pm View
See this article:

Ravi Bhavnani at 19-Apr-14 23:31pm View
Your question is too vague. It's like asking someone, "How do I fly a plane?". If you have a specific question or problem, feel free to post it here. Otherwise first take the time and trouble to understand your problem domain and design a solution.

Ravi Bhavnani at 16-Apr-14 10:39am View
Odd - it works for me. You can also just visit

Ravi Bhavnani at 16-Apr-14 8:14am View
Did you try clicking the link in the solution?

Ravi Bhavnani at 3-Apr-14 13:15pm View
> i am going to know that how time slot is making.
That's for you to figure out. You can't expect us to design your algorithm.

Ravi Bhavnani at 3-Apr-14 12:36pm View
Your question is too vague to be answered. Remember, we can't see your screen or read your mind. What is "all the information which is necessary for this"? If you expect to receive and answer, post a specific question and include what you've already tried to do and where you're having a problem.

Ravi Bhavnani at 31-Mar-14 13:58pm View
Thanks. :) I only mentioned it because I thought it fit the bill nicely.

Ravi Bhavnani at 28-Mar-14 11:40am View
> one experienced Java programmer told me that .net will be out of the market by 2016
Considering that Java is playing catch-up to C#, I highly doubt the veracity of that statement. See:

Ravi Bhavnani at 23-Mar-14 11:13am View
> the problem occurred when my text5.text remained blank.

Sorry, I don't understand what you mean by this. Did you mean to say you encounter a problem when textBox4 (not 5) is blank?

Ravi Bhavnani at 21-Mar-14 15:25pm View
'Twas a wild guess, with a little bit o' help from Google. :)

Ravi Bhavnani at 11-Mar-14 11:05am View
Welcome back! Chris should be able to merge your old/new IDs.

Ravi Bhavnani at 11-Mar-14 10:15am View
> specifically checks foe a null value and returns string.Empty
Ah. Thanks!

Ravi Bhavnani at 11-Mar-14 8:32am View
I think the call to .Trim() is extraneous (and dangerous if myTextBox.Text is null) since the input filter guarantees the TextBox will contain only the period or numeric characters.

Ravi Bhavnani at 7-Mar-14 22:59pm View
In all seriousness, I felt the OP needed guidance. I recall doing almost the same thing (creating a large bunch of if-else statements) when I tried to write Adventure after 2 lectures of Programming 101. :)

Ravi Bhavnani at 7-Mar-14 19:19pm View
I assume you were being sarcastic. :P

Ravi Bhavnani at 7-Mar-14 17:35pm View
Put simply, your app's logic should look like this:

do {
determine what to ask;
ask question, get response;
process response;
while (!gameOver());

Ravi Bhavnani at 6-Mar-14 15:09pm View
More correctly, "override and optionally add" not "add/override".

Ravi Bhavnani at 5-Mar-14 14:08pm View
You seem to have mistaken this forum as a means to have someone do your homework for you. If you have a specific question ask it, but don't expect anyone to give you a solution to your assignment.

Ravi Bhavnani at 2-Mar-14 16:33pm View
See this link:

Ravi Bhavnani at 23-Feb-14 18:07pm View
I assumed you had a question about the article I pointed you to. If so, please post your question there.

Ravi Bhavnani at 23-Feb-14 0:14am View
Please post your question in the article's forum so that the author is able to respond. You could also directly email Matt by clicking the "Email" link in any of his replies or just visit

Ravi Bhavnani at 18-Feb-14 11:56am View
Is the .Color property being overwritten when Latency is in fact zero (at a later point in your loop)?

Ravi Bhavnani at 18-Feb-14 11:37am View
Also, your if statement is formed oddly. See my solution to your previous question.

Ravi Bhavnani at 18-Feb-14 11:11am View
Have you tried setting a breakpoint in your code to ensure Latency is in fact non-zero?

Ravi Bhavnani at 15-Feb-14 23:01pm View
You're absolutely right, Sergey.

Ravi Bhavnani at 15-Feb-14 23:00pm View
Glad to be of help!


Ravi Bhavnani at 15-Feb-14 14:42pm View
In addition to the other comments, I suggest you don't use txtspk.  Take the trouble to formulate your question properly if you expect the CodeProject community to take the trouble to help you.

Ravi Bhavnani at 15-Feb-14 14:40pm View
How do you expect to learn anything if you don't do your own work?

Ravi Bhavnani at 12-Feb-14 14:23pm View
As Sergey has already pointed out, consider using FFMpeg to extract images from your video file. See the answer to this SO question for the command line:

Ravi Bhavnani at 10-Feb-14 15:37pm View
No, it won't. You can't modify a collection you're traversing.

Ravi Bhavnani at 10-Feb-14 15:37pm View
No, it won't. You can't modify a collection you're traversing.

Ravi Bhavnani at 26-Jan-14 20:54pm View
You need to take a step back and review the basics of programming. These concepts aren't easily explained in an answer to a forum post.

Ravi Bhavnani at 25-Jan-14 20:17pm View
Check out this 5 minute tutorial from

Ravi Bhavnani at 25-Jan-14 20:12pm View
Check out Pluralsight @ The courses "C# From Scratch" and "C# From Scratch Part 2" may be the best coin you'll spend on learning how to program in C#. I highly recommend them.

Ravi Bhavnani at 25-Jan-14 19:56pm View
Have you approached your instructor for assistance? It seems what you need is more instruction about the basics of object oriented design. Unfortunately that's not something that's easy to convey in a few lines in a forum post.

Ravi Bhavnani at 25-Jan-14 19:52pm View
Actually I was just about to commend you on your effort! I personally think the OP won't benefit from your reply and is fishing for codez.

Ravi Bhavnani at 25-Jan-14 19:51pm View
Actually I was just about to commend you on your effort! I personally think the OP won't benefit from your reply and is fishing for codez.

Ravi Bhavnani at 25-Jan-14 19:46pm View
I think you'd be better off asking this question of the authors of DocPanelSuite (

Ravi Bhavnani at 25-Jan-14 19:42pm View
If you have absolutely no idea how to go about this, I suggest you take another look at your class notes. Then, if you have questions about implementing specific facets of this assignment, post your code along with your question and we'll try and help you. But don't expect someone else to attend class and study on your behalf.

Ravi Bhavnani at 16-Jan-14 17:45pm View
idenizeni has provided you a full solution below. I corrected their response - the upper bound check was off by one.
Ravi Bhavnani at 6-Jan-14 12:49pm View
Shouldn't you be checking the event on a TabPage (and not TabControl)? TabPage is a Control and handles MouseHover.

Ravi Bhavnani at 27-Dec-13 22:21pm View
What have you tried so far?

Ravi Bhavnani at 26-Nov-13 13:21pm View
As mentioned by Ron (solution 1), I too strongly recommend TFS hosted by Microsoft.

Ravi Bhavnani at 15-Nov-13 12:58pm View
Should you be using port 587?

Ravi Bhavnani at 5-Nov-13 16:36pm View
It's not that hard. Manfred has provided a good clue.
Ravi Bhavnani at 5-Nov-13 16:32pm View
Sorry, we're not here to do your homework.
Ravi Bhavnani at 5-Nov-13 16:20pm View
Did you read the documentation on Graphics.DrawLine() in my updated solution?
Ravi Bhavnani at 5-Nov-13 16:02pm View
That vital piece of information was missing from your original question. See my updated solution.
Ravi Bhavnani at 17-Oct-13 10:43am View
Do you seriously expect someone to do your homework for you?

Ravi Bhavnani at 8-Oct-13 11:26am View
Is your connection string correct?
Ravi Bhavnani at 2-Oct-13 17:37pm View
I was just about to tell you that. :)

Ravi Bhavnani at 2-Oct-13 15:40pm View
Google tells me a MessageDialog() should work. Have you tried that?
Ravi Bhavnani at 29-Sep-13 17:25pm View
This (current) C# library seems to have promise:

Ravi Bhavnani at 29-Sep-13 16:55pm View
I think you need to use TagLib# for that. See

Ravi Bhavnani at 26-Sep-13 8:00am View
1 - Did you import Microsoft.VisualBasic.Devices?
2 - As the SO post says, this is available in Vista and later.
3 - Did you read the MSDN article?

Ravi Bhavnani at 17-Sep-13 10:35am View
It isn't clear what you want to do. What do you mean by "calculate km/hr in C#"?
Ravi Bhavnani at 11-Sep-13 21:56pm View
It's a tool I'm building. Didn't want have to interop with IM. Also tried AForge, but it expressly indicates it doesn't have a drop shadow filter.
Ravi Bhavnani at 11-Sep-13 17:23pm View
Thanks, Pete! That works as described. I was hoping to write a GUI-less command line app that would add a dropshadow to a collection of images, but I think the key is to have a DrawingVisual that requires a physical screen. Thanks again!

Ravi Bhavnani at 11-Sep-13 15:42pm View

Thanks, Pete!

Ravi Bhavnani at 11-Sep-13 15:10pm View
Thanks for trying. :)

Ravi Bhavnani at 11-Sep-13 15:07pm View
Pete, I'm trying to port the dropshadow filter in this VB .NET article to C#. i.e. I'm trying to build a shadowmaker that will operate on a bunch of .png image files.

Ravi Bhavnani at 11-Sep-13 15:05pm View
Adding a drop shadow to a text string is not the problem I'm having. I want to add a drop shadow to an image.

Ravi Bhavnani at 11-Sep-13 15:04pm View
That's not the problem. My original image *is* being loaded (confirmed because the generated file looks exactly as the source image). The problem is writing the modified (dropshadow'd) bitmap.

Ravi Bhavnani at 11-Sep-13 14:31pm View
The Opacity property defaults to 1.0. A FileStream is a Stream.

I don't understand what you mean by "Start with the transparent image and overlay (or print) source image.". My source image has a transparent background. I want to add a drop shadow effect to that and print the resulting image.

Ravi Bhavnani at 11-Sep-13 14:05pm View
Yes, I know that works. :) What I'm trying to do is save the modified image to a file. That doesn't seem to be working. (My end goal is to write a command line app that will add a shadow to a large number of images.)

Ravi Bhavnani at 11-Sep-13 13:11pm View
If you look at my code, you'll notice it's functionally identical. I'm not using a Grid because I don't need to enclose the Image in one. If I give the encoder a BitmapFrame created from "bi", the file contains the original (unmodified) image, so I know my scaffolding is correct.

Ravi Bhavnani at 10-Jul-13 12:27pm View
If you want more security, you could use SSL.  That way even with Fiddler casual users won't be able to view the key encrypted credentials.

Ravi Bhavnani at 27-Apr-13 16:25pm View
If you post your project I can take a look at it. There's no reason why the .Text.Length property should only "count up to 9".
Ravi Bhavnani at 27-Apr-13 9:52am View
It doesn't count up to only 9. Most likely, the AutoSize property of your label control is False, which limits the number of characters displayed. Change it True so that the label can grow to fit the size.
Ravi Bhavnani at 27-Apr-13 9:52am View
It doesn't count up to only 9. Most likely, the AutoSize property of your label control is False, which limits the number of characters displayed. Change it True so that the label can grow to fit the size.
Ravi Bhavnani at 27-Apr-13 9:44am View
Your solution doesn't display the word count, just the total number of characters in the rich text box.
Ravi Bhavnani at 27-Apr-13 8:56am View
Yes, I corrected my typo.
Ravi Bhavnani at 26-Apr-13 23:17pm View
What exactly do you mean by "something is wrong with my code"? Does it compile? If not, what errors does the compiler report? Does it cause an error when run? If so, what's the error?

Ravi Bhavnani at 5-Apr-13 17:59pm View
I'm no SQL expert (as a matter of fact I'm not an expert at anything), but aren't you specifying a slew of extra parameters when "jobId" and "email" are the only ones supported?

Ravi Bhavnani at 5-Apr-13 17:56pm View
Does this answer your question?

Ravi Bhavnani at 5-Apr-13 17:53pm View
It depends what you mean by "shown in full". If you mean maximized, simply do:

this.WindowState = FormWindowState.Maximized;

Ravi Bhavnani at 21-Feb-13 12:44pm View
Your question doesn't make sense. A progress bar is used to indicate the progress of an operation and has nothing to with opening a new form. Did you mean you want to close the current form and display a new form when your progress bar indicates the process has completed?
Ravi Bhavnani at 6-Feb-13 13:22pm View
As Sergey has already pointed out, NLP is a non-trivial endeavour. That being said, you may want to take a look at SharpNLP ( and Jiayun Han's work at

Ravi Bhavnani at 31-Jan-13 14:03pm View
If a desktop app would suffice, you could write a simple app that periodically checks the db for new deal records since the last check, much like an email checker app. The app would run in the system tray and display a visual notification (and even open the browser to the app's login page, if configured to do so) when a new deal is written.

Ravi Bhavnani at 23-Jan-13 11:21am View
Shouldn't the 2nd argument to ExecCommand ("EditMode", ...) be true instead of false? I assume you want to display the editing UI?
Ravi Bhavnani at 6-Jan-13 11:30am View
Does this Linq link help?
Ravi Bhavnani at 30-Dec-12 2:11am View
A key exchange occurs. The most common algorithm to perform this is Diffie–Hellman. See
Ravi Bhavnani at 28-Dec-12 23:57pm View
Also see this link:
Ravi Bhavnani at 28-Dec-12 23:50pm View
Wow, what an about-face that was. You may want to consider using a RichTextBox control. Pasting images will be tricky, though. See
Ravi Bhavnani at 28-Dec-12 23:41pm View
You may want to consider using a ListView control with its View property set to LargeIcon. That will give you the ability to display images and text and also drag/arrange the icons in a grid. I'm assuming this is the kind of functionality you're looking to implement.
Ravi Bhavnani at 28-Dec-12 23:28pm View
There's no magical library that will make it easy to build an app that works like an electronic smart board. At the least, you'll need to have a server and client component, where the server listens for and broadcasts changes to the data on the whiteboard to all connected clients. This is non-trivial at best and doesn't allow for a "one-size-fits-all" solution.
Ravi Bhavnani at 28-Dec-12 1:54am View
Did you try Google? See

Ravi Bhavnani at 26-Dec-12 11:06am View
Your question is too open-ended. We can try to help if you're having problems with a specific task. But don't expect anyone to help you build a non-trivial application from the ground up.
Ravi Bhavnani at 24-Dec-12 13:22pm View
Cool! I've been building something similar (a basic photo cataloger). Will post an article on CP one of these days.

Ravi Bhavnani at 24-Dec-12 13:11pm View
You may want to consider having a background thread load images (into Image objects), then set the loaded Image into the PictureBox. This has 2 advantages: (1) your UI will not be locked and (2) the image file will not be locked by the .NET PictureBox. See this method:


/// Loads an image from a file without locking the file.


/// <param name="filename">The filename.</param>

/// The image.

public static Image ImageFromFile (string filename)


using (FileStream stream = new FileStream (filename, FileMode.Open, FileAccess.Read)) {

return Image.FromStream (stream); }


PS: Please rate my answer if you find it useful. Thanks.
Ravi Bhavnani at 20-Dec-12 17:16pm View
No service reference needed - simply make an HTTP request and parse the XML result!
Ravi Bhavnani at 19-Dec-12 20:47pm View
I don't know of any free C# to Android binding SDK other than Xamarin. They have an unlimited free trial - the only catch is you can't upload your .apk to a device, just the emulator.

Ravi Bhavnani at 9-Dec-12 11:59am View
What kind of app is this? A web app, a Windows Forms app or a WPF/Silverlight app?

Ravi Bhavnani at 30-Nov-12 13:10pm View
You might also find this article helpful:

Ravi Bhavnani at 30-Nov-12 13:09pm View
HTMLAgilityPack is very cool. Also see my StringParser article - I wrote this class to do exactly what you want to do and have used in with much success in a couple of widley used products.

Ravi Bhavnani at 28-Nov-12 8:25am View
Your question is too vague. Please provide details about a specific problem you're having if you expect us to help.


Advertise | Privacy | Mobile
Web03 | 2.8.150520.1 | Last Updated 1 Jan 1900
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid