vb.net

Add information to datagridview (VB.NET)

Ok I change my question... I have two split-arrays and two columns (first name and last name). How can I add my two split-arrays to my datagridview? My code does not work, because all last name entries are at first name. For k = 0 To UBound(array1) datagradview.Rows.Add(array1(k)) For i = 0 To UBound(array2) datagrad...

Best Practice for storing settings for a .NET Windows Service: Service Property Settings, Serialization, ...

I am working on a .NET Windows Service where I am trying to store settings that will be used when the service is started and while it is running. I have searched through posts on SO and found that using the Settings in the properties of the project is great for use with console and winforms applications. However, Google and SO are sile...

Execute ClientSide before ServerSide in ASP.NET

I am using ASP.NET 3.5. When the user click on say btnSubmit I want to first execute some JavaScript code and then execute some C#/VB.NET code. Is this possible? If so how would one do it? Thanks in advanced! ...

VB.NET: Prepend a string to all strings in a list of strings. Is there an existing method that does this?

I have a list of strings. For each string in that list, I want to prepend another string. I wrote a method to do it, but I was wondering if there was something already in .NET I could use to do this. It seems like something that could be built in, but I was not able to find anything. Here is the method I wrote: Private Function Prepen...

Can I turn a Microsoft.Office.Interop.Excel.Chart object into a Microsoft.Office.Tools.Excel.Chart object?

Basically I've coded an Excel 2007 project in VB.NET 2010 that allows you to create charts with a fair amount of interactivity. I want the user to be able to save and reopen this workbook and still have that interactivity in any already-created charts, so they don't have to re-create them. When I create the charts, I use Sheet1.Controls...

How do I tune up my C# Skills, when I have spent the last decade coding in VB?

I started my career coding in C/C++ on a vax system, but got into a few contracts where it was all VB and then became a specialist in VB, then to VB.net. Now I am aspiring to work for Microsoft and it seems that every job they post is in C/C++/C# and I can barely read C# code, it looks like the most convoluted mess to me and the inline s...

MailMessage & MAIL/EXPN/VRFY/ETRN

I was told that my program was not issuing a MAIL/EXPN/VRFY/ETRN when sending an email by the web hosting company we are connecting to. Anyone know what this means and how I do it? I am sending an email with SmtpClient and I have no problems with other clients. Here is what I was told: Thanks for the additional info, here is wha...

How do I allow user to filter DataGridView (Linq to SQL, Winforms)

How do I allow user to filter the DataGridView with a Linq to SQL source? I want to allow the user to filter on any field, like you would expect from Access or Excel. With datasets, I could build up a query string and use that as a BindingSource filter. What's a good way do do the equivalent with Linq to SQL? I could write a LINQ que...

is there an equivalent to trace=true in Winforms?

I have a winform that is taking too long to load. The form has a gazillion of controls and I would like to see how much time each control takes to load. If it were a web app, I would have just turned the trace on, but I can not find anything similar in winforms. Any thoughts? Thanks. ...

Better option for hosting MS Office documents in custom app?

I am currently hosting an IE Browser control in a .NET (2.0) Form and using it to load Office files such as Excel and Word thusly: _ieCtrl.Navigate("C:\\test.xls", False); The hosting and loading works well except whenever I navigate to a file I am presented with a dialog that asks whether I want to save or open the file. (This is sta...

VB.NET call desktop application from 2 shortcuts - supply different parameters

I have a desktop application which reads files from a specified folder, then deposits the files to a folder in a third party document management system based on criteria that the user provides. My question is: is it possible to somehow provide different parameters to the code, depending on which shortcut of the application the user cli...

Issues with checking the equality of two doubles in .NET -- what's wrong with this method?

Hi, So I'm just going to dive into this issue... I've got a heavily used web application that, for the first time in 2 years, failed doing an equality check on two doubles using the equality function a colleague said he'd also been using for years. The goal of the function I'm about to paste in here is to compare two double values to...

Graphics.Drawstring looks nice in PictureBox but horrible in a Bitmap

I am trying to use DrawString to write text as an image and then rotate it 90 degrees. It works fine with both a bitmap or directly on a PictureBox, but the big difference is in the quality. The PictureBox text drawn has great quality and looks nice. When I draw it on an image it looks horrible and blocky. I've made a few changes to ...

VB.NET - Set external process priority to Low / Pause external process (while running)

Developing a UI for an image compactor, and I have built a Pause/Resume button. I need it to pause/set priority to low while it is running. Now I know that it is dangerous to Pause a process and has to do with threading, but if someone knows how to do this, please help! Also, if the above cannot be done efficiently enough, I would ra...

Global.asax and web application lifetime

Question: When a webapplication gets started, it executes Application_Start in global.asax. Now, a web application gets started as soon as the first request for a page in that application reaches the server. But my question is: how long will the application run until the application is stopped. I mean when after the first page request...

How to get ALL child controls of a WinForm of a specific type (Button/Textbox)?

I need to get all controls on a form that are of type x, I'm pretty sure I saw that code once in the past that used something like this: dim ctrls() as Control ctrls = Me.Controls(GetType(TextBox)) I know I can iterate over all controls getting children using a recursive function, but wondering if there is something more easier or str...

VB.NET: Declaring a function inside a base class non-overridable

I have a base class foo that will be used in multiple child classes of similar but slightly different function: Public MustInherit Class foo Public Function bar1() as Something ''// Perfectly OK to change what this method does End Function Public Function bar2() as Something ''// Does a very specific thing I...

Application's shortcut keys "swallowed" by child components

In my main application Form I have a number of menu and toolbar button functions to which I have assigned shortcut keys such as F10, F11 and F12. The shortcuts work well except for instances where certain controls have focus, such as a 3rd-party grid control. In that case the F11 or other shortcuts are handled by that control and swallow...

stop timer (VB.NET)

hello, how can i stop a timer after one time? thanks ...

Documentation for Bouncy Castle AES 256 encryption in .Net?

I'm trying to implement the Bouncy Castle encryption library in a .Net project, but am not finding a lot of .Net-related documentation. The class/method structure isn't even close to the ample Java-related examples. Does anyone have some good .Net examples for this? Thanks. ...