vb.net

Scaling image for printing

I'm using the following code to print an image from a PictureBox. All works great except for scaling images down if they are bigger than the print page. Is there a method I'm missing to do this? Screenshot, large image outside of the paper bounds: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) H...

Add links to datagridview

hello, i hava a datagridwview with a datagridviewlinkcolumn and a split array with the links. How can I add this links from the array to the datagridviewlinkcolumn? thanks ...

[VB.NET]Transferring data from 1 file to another

Basically I want to take My Client. Then for example Lets say in my client I have "A = 1" Then my 2nd file which has random data in it. So Client= My Client File = The File which I want in the end result How could I Inject "A = TextBox1.Text" from Client to File. I heard it's called "End Of File" or something like that. Any help please?...

WebServiceBindingAttribute is required on proxy classes

I m facing an exception when call a web method of my web service , the exception generated when the method is creating object of Microsoft.Web.Services3.WebServicesClientProtocol. The code segment of method is : <WebMethod(), SoapDocumentMethod(Action:="http://tempuri.org/service/SetClientCredential", _ RequestElementName:="Defaul...

How to pass user details between objects in VB.net?

I'm redesigning an old VB6 application into VB.net and there is one thing I'm not sure on the best way to do. In the VB6 application whenever we created a new instance of a component, we would pass in the user details (user name and the like) so we new who was performing the tasks. However, no that I'm redesigning I've created some nice...

Dynamic content switching based on stylesheet

Hi! I'm making a new design for my website, but I want to keep the old one and possibly switch between the two. Unfortunately, I've changed the content on the Master Page (luckily I have a backup). What I was thinking was to keep separate master files for each theme, and then just determine which one to server based on which stylesheet...

VB.NET: Ambiguous class name error when no ambiguity exists.

A client of ours reported that when trying to use our .NET .DLL in VB.NET they receive the error: error BC31429: 'OurClass' is ambiguous because multiple kinds of members with this name exist in namespace 'our.company.nspace' I've also been able to reproduce the error with a dummy project containing the single line of Dim x as our...

Should development of a new application be in C# or VB.NET?

Should development of a new application be in C# or VB.NET? How can we decide which language to use when there is no customer or resource requirements? Is it dependent on the flavor which we like the most? ...

Can you convert this to VB?

static RelatedPosts() { Post.Saved += new EventHandler<SavedEventArgs>(Post_Saved); } static void Post_Saved(object sender, SavedEventArgs e) { if (e.Action == SaveAction.Update) { Post post = (Post)sender; if (_Cache.ContainsKey(post.Id)) _Cache.Remove(post.Id); } } I converted to: Shared Sub New() Post.Saved += New E...

Active Directory User Group Membership

I am trying to get a users group membership and limiting the results to those that match a string, ie I am only interested in the users group membership where the group begins with "test-". The following is what I have been playing around with, even though the user is apart of several groups that match the search string, the If statemen...

Always Throwing Exception

Hello to every one, I've crated simple registration using Mysql connection in Vb.net but I am always getting exception error while form is loading but after closing dialog my registration form is loading and working properly. Where I am doing mistake? Anyone can help me with below code? Public bool2 As Boolean = True Dim mysqlconne...

Why does hiding the child form also hide the parent form?

I have three forms: A, B and C. Upon a button being clicked, A displays B. Similarly, B displays C. Both using the ShowDialog() method. However when I use the Hide() method (inside a Button Click event) on form C to close it, form B also closes. Why would this be? As far as I can see, it shouldn't be doing this. I certainly didn't wri...

Display dropdown menu in gridview with autogeneratecolumns enabled

I see a bunch of solutions about editing the template, but seeing as how my gridview changes between 10 different datasources a template isn't possible. Any idea of how I can accomplish this? ...

Visual Basic 2010 String Containing a Speech Mark

How can I make a speech mark in a string? The following shows the whole of the line and all code after that (With the Express IDE) to be a comment as well: Variable = "\"" ...

Selecting results from DataSet

I have a DataGridView bound to a DataSet. I only want a selection of columns displayed on the DataGridView rather than all. I then have a text box which I want to display a value (Version_no column) from the column not showing in the DataGridView. Is this possible? Would it be better to have a hidden column on the DataGridView and use ...

ASP.Net String Assignment Failure

This is my first post here, so go easy on me :) I'm having an odd problem with an ASP.Net page. I'm getting an object not set error message when assigning a string literal to a variable. Here's the error I'm getting. [NullReferenceException: Object reference not set to an instance of an object.] Project.Page.Page_Load(Object...

What is wrong with this linq query?

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim ds As DataSet ds = getData() Dim dt As DataTable = ds.Tables(0) Dim gridViewData = From r As DataRow In dt.Rows Select r.Item("foo"), r.Item("bar") GridView1.DataSource = gridViewData GridView1.DataBind() End Sub I j...

vb.net and ContextMenuStrip ?

I'm using winforms and vb.net. When I right click on a textbox I get the copy/paste/etc popup menu. This is ok. But How can I add something to this menu, and where/how would I intercept the event when one would click on the Item I add to it? ...

Format() not working in Visual Basic (Visual Studio 2005/ Win 7)

Hey everyone, I am having a problem with Format not working. I have tried several standard formats but it doesn't effect the output at all. Dim tempstring As String = Format(Now(), "M, m") and Dim date As Date = Format(Now(), "M, m") both have a final value of "8/16/2010 10:52:21 AM" Thanks for the help. Update I am still having pr...

How Can i Get the Current Local Host Name using C# or VB.NET?

I need to get the host name currently running the application. Any idea? ...