Have Forms In Sub-namespaces Of A WinForms Project?

Oct 15, 2010

If I create a new class library project in VB.NET, I can create subfolders (a la C#), add WinForm objects to these subfolders, and then specify a namespace:

Namespace Sub1.Sub2
Public Class SomeForm
Public Sub New()
InitializeComponent()

[code]...

This resolves as ProjectRootNamespace.Sub1.Sub2.SomeForm, which is good.However, if I create a new WinForms project in VB.NET, and attempt the same thing, I get this error in the designer:The class SomeForm can be designed, but is not the first class in the file. Visual Studio requires that designers use the first class in the file. Move the class code so that it is the first class in the file and try loading the designer again.Is there a way to have forms in sub-namespaces of a VB.NET WinForms app instead of in the root namespace?

View 1 Replies


ADVERTISEMENT

C# - Get List Of Namespaces Available In Project In ASP.NET?

Feb 8, 2012

I have ASP.NET Application: I have added 5 classes with different Namespacess in App_Code folder..

In Default.aspx.cs file.. I just want to get the list of available Namespaces in App_Code folder:

I tried : AppDomain.CurrentDomain.GetAssemblies();

but i didn't find Namespace that is available in App_Code Folder

View 1 Replies

IDE :: Importing Namespaces In Project Level?

Mar 16, 2009

i hav a problem in building a solution in vs 2008.I'm opening vb.net project in VSS repository.When i tried to build the application its giving lot of compile error.After examining the code i've found that the namespaces are not imported in *.vb file , hence the types used in the file are not accessible .I know that we can import namespaces at application level

View 1 Replies

Adding 1st Explictly Named Namespace To A Project Breaks The Use Of Implicit (i.e. Global) Namespaces?

Sep 27, 2010

I am working on a solution that does not name namespaces in code files. Instead it uses the root name space of the project (which is the same across all assemblies). Basically there is only one implicit namespace.

Well, I am trying to isolate some code so that I can run FxCop against it. I explicated named the code file with a namespace to do this. This works for FxCop, but it bricks the entire solution.Visual Studio is now asking me to prefix all uses of the implicit namespace with Global. So instead of:

[Code]...

View 1 Replies

IDE :: Set Project Default For Winforms Projects S/ Default Modifier For Controls Added To Winforms Is Private

May 28, 2010

Is it possible to set a project default for VB.NET winforms projects so that the default Modifier for controls added to winforms is Private (not Friend)?I know there's a "modifiers" property in the properties window so I can set it for each individual control however I would like to change the project so from now on myself and other developers have to specifically decide to change from friend to private. (Which I would strongly discourage them from doing).I believe there is no way of doing this, but on another forum a while ago someone mentioned it would be possible with an add-in (but didn't name the add-in or where to get it).

View 1 Replies

Include Contact Project Into Another Project / Add More Items To Database / Forms In New Project?

May 6, 2009

I have a project that I have created, it something like a contact database.It is complete with its own sql server database, and controls and forms.I kinda of understand that I can include this project into another project.This is the tricky part,Can I include my contact project into another project and add more items to the database and forms in a new project?What I'm after is like using classes.My contact database would be like the base class, and the new project would be adding more features to that project.

View 10 Replies

Can't Start WinForms Project Because Form Is A Type

Sep 27, 2011

I have a very small VS2008 Winforms project that will not start.When I attempt to start debugging the project, I get the message:'<form>' is a type in '<project>' and cannot be used in an expression.From the file .Designer.vb.The problem is that is indeed a form. If I create a new WinForm and set the startup object to the new form, I get the same message.When I attempt to check the "Enable application framework" checkbox in the Project properties, I get the message "Startup object must be a form when 'Enable application framework' is checked.I've tried creating a new project and moving all the code and designer objects to a new form file in the new project, and same result.Other projects on the same computer run fine.

View 1 Replies

Design View Of Form In 2010 Winforms Project?

Apr 27, 2012

Is there a shortcut to get to the designview form in a winforms project in visual studio 2010.F7 will take you to code behind class form and shift + F7 will take you to design mode. Is there a shortcut to filename.designer.cs formWhere you have the control definitions, delegates (for click event etc). defined. I go to the form often if I change the name of click event etc.I have to go through solution explorer and click on the file. Is there a shortcut like F7 that opens the designer.cs file?

View 1 Replies

Visual Studio WinForms Creating An Installer (.exe) To A .sln Or Vb Project

Mar 5, 2012

i've created a very simple .exe file on my project in vb winForms but i don't know if i have crystal reports, Database, .swf files on my project.

View 3 Replies

Winforms - Multi Branch Desktop Based Project?

Mar 21, 2010

I am currently working on a multi branch desktop based project using VB.NET 2008. My Admin want to see the list of currently working branches and not working branches. Additionally they want to know how long a branch is not working.

To display the offline branches I first take a ListBox control named lstListBranch and then upon that control I take another ListBox control named lstListTime to display the offline time.

I want to permanently hide the scrollbar for lstListTime control and want to scroll lstListTime when lstListBranch is scrolled.

View 2 Replies

Winforms - Run A Flash Exe File Within A Window/Form In A Project?

Oct 16, 2009

How do I run a Flash exe file within a Window/Form in a VB.Net Project? I do not have the SWF file so will have to use the exe file I have.

View 2 Replies

Importing Microsoft.Reporting.WinForms Into Console Application Project?

Jul 26, 2010

I've created a VB Console Application Project and am trying to instantiate a Report Viewer object. To my understanding I need to import Microsoft.Reporting.WinForms however Visual Studio does not recognize this name space. Is there some reference I need to add?

View 4 Replies

Forms :: Delete Cookies In Winforms?

Nov 27, 2009

I've been trying to know how to delete all the cookies of a domain, created by using the WebBrowser control.I know that to invalidate a cookie, it's necesary to set its expiration date in a point of the past (a negative value), but all the information I found is for web developing aplications, and I'm using a form.

View 4 Replies

Forms :: Using Large Database In WinForms?

Dec 27, 2009

I am currently helping to write a Visual Basics program that was originally writing with access.The Original Access program has been used and modified over the past 5 years, During that time the database has gotten pretty big.The problem I am having is If I add the entire database to my data sources it creates data tables for every Table and Stored procedure even when they are not currently used in the program resulting in a 20+ minute build time just to debug.I am currently only adding Tables and Stored Procedures as i need them, so its not that much of a problem now, but as I continue to work and add tables the build time is going to go back up, and Id hate to have to wait 20+ minutes to test a small tweak I made.

View 1 Replies

Forms :: VS2010 WinForms Labels?

Nov 4, 2011

I have a label that displays text kinda like a title to something (autosize = falseTextAlignment = MiddleCenter) and whenever the label control isn't wide enough to display the single line of text it tries to auto-wrap it causing half of the text to be chopped off at the top and half of it chopped off at the bottom. I would rather it stay on a single line and cut the text off from the right

View 1 Replies

Winforms - Custom Constructors For Forms In .net?

Nov 1, 2010

I would like to open a new form from some other form, and pass some selected object from a control on that form to the new form. The sensible way to do this, I thought, was as a parameter to the forms constructor. Now I know that the visual studio GUI creates partial classes for my forms, that hold the properties that I can drag onto there in the designer. I assume it also holds a default constructor. Since it might do all sorts of stuff that is needed to initialise the form, I figured I should call it from my custom constructor ala

public sub new(byval my_parameter as Foo)
Me.new()
Me.my_parameter = my_parameter

[code].....

That clearly wasn't it, because it can't find a default constructor. The thing is, visual studio goes trough great lengths to prevent me from seeing the generated constructor, so I know how to access it. This leads me to believe that I am actually doing it wrong, and should have set out on some different path, as the path you are forced in to usually is the sensible thing to do, which I usualy find out way too late.

View 3 Replies

Winforms - Friend Vs. Public For .net Forms?

Jan 19, 2010

Is it better to use friend or public forms in vb.net? What are the advantages of each?I notice when you import a vb6 project, the forms come in as friend, but when you add a new form in vb.net it is public. I have not seen any difference in the way they work, though, so I must be missing something.

View 3 Replies

Winforms - Passing Values Out Of Forms?

Sep 8, 2011

I have a very simple windows forms setup. Form1 has a progress bar and a button on it, when clicked the button opens Form2 which also has a button on it that launches Form3. On Form3 is a button which I want to use to raise an event back to Form1.To achieve this can I add an event handler on form1 that will listen for an event of the type raised in form3? Or do I have to pass references to form1 to form2 and then from form2 to form3?

View 1 Replies

Winforms - Unload All Open Forms ?

Feb 26, 2009

In the middle of converting VB6 code to VB.NET, I need to replace the following code that intends to close all open forms remaining in the application.

'close all sub forms
For i = My.Application.OpenForms.Count - 1 To 1 Step -1[code].....

I've replaced the Unload function with Close (as indicated by TFM), but the compiler complains that OpenForms is not a member of My.Application.Where can I access the open forms?

View 4 Replies

Forms :: Creating A Sub Main In A Windows Forms Project?

Sep 13, 2010

What is the vb.net equivalent to accomplishing this?

static void Main()
{
frmCalcView view = new frmCalcView();

[code].....

View 5 Replies

Forms :: VS2010 WinForms App Connect To Dll On Webserver?

Nov 13, 2011

I have a desktop WinForms app that I would like to be able to connect to my Sql Server database that I have through my GoDaddy webhost. Problem is not all ISP's forward the 1433 port (like mine) so I can't connect directly to the DB from any of my home computers without buying the expensive dedicated IP address package, which has me thinking since my website can connect directly to the DB I was wondering if it might be possible for me to make a dll that would have all of the database interaction through subs and functions and all my WinForms app would have to do is connect to that dll through http or something, anyone know if I could do something along those lines?

Reason for this is I would like other people to be able to connect to this database (the winforms app would have screens for creating and managing accounts, etc) without worrying about whether their ISP would block the DB port(s) it would just work.

View 5 Replies

Winforms - .net NUnit (2.5) Windows Forms Testing?

Oct 18, 2011

I am retrofitting unit testing into a fairly complex system designed and written by other developers in VB.net. I am trying to develop unit tests for the GUI forms using NUnit and the NUnit Forms extension. (I've been looking at c# examples that are fairly easy to port over if you have a solution but don't know VB syntax as long as it uses NUnit classes)

I will try and explain what I am doing but first a brief description of the program. It basically monitors server activity. You need to connect to a server via a modal form with IP and Port fields(amongst others). Once you have connected to a server other parts of the program unlock and become usable (such as configuration of the server).

Desired process: Load program > click connect button > modal connect form loads > enter details > click OK to connect > main form updates to logged-in state > other functionality

The problem is that I cannot test the functionality of the connect form and then the logged-in functionality of the program. I can test that it loads the modal connect form correctly; enters the details and clicks OK (all fine so-far) but it does not appear to logically progress the program. The modal form just closes again seemingly without running the connect code from the program back-end and I'm back at the main menu not logged in to anything.

I have a feeling that I've either missed something really obvious or that it's simply not doable in NUnit.I have trawled the internet in search of anything similar but the closest was another SO thread that was really generic. Without being able to actually test the logged-in version of the program, I'm at a major hurdle.Another issue is handling message boxes that don't have unique identifiers (e.g. "are you sure you want to exit?"); these also seem to be a major pain in the arse with NUnit (If it makes any difference, I'm running the tests as a stand-alone project using a reference to the executable file of the built project, not the actual source)

View 2 Replies

Winforms - Deploying A VB 2010 Win Forms Application

Nov 16, 2010

I am deploying a VB.net 2010 winforms application, and when I install it on the client's machine, the install process also installs an instance of SQL Server 2005 Express. The application connects to a central SQL database on the server. To install, I am using the "Publish" option in VS 2010. Why does it do that? There should be no need for a local instance of SQL Express. Is there a way to avoid installing SQL 2005 Express (I know it is free, but I would rather not have it installed if possible).

View 1 Replies

Winforms - NUnit (2.5) Windows Forms Testing ?

Jun 10, 2012

I am retrofitting unit testing into a fairly complex system designed and written by other developers in VB.net. I am trying to develop unit tests for the GUI forms using NUnit and the NUnit Forms extension. (I've been looking at c# examples that are fairly easy to port over if you have a solution but don't know VB syntax as long as it uses NUnit classes)I will try and explain what I am doing but first a brief description of the program. It basically monitors server activity. You need to connect to a server via a modal form with IP and Port fields(amongst others). Once you have connected to a server other parts of the program unlock and become usable (such as configuration of the server).Desired process: Load program > click connect button > modal connect form loads > enter details > click OK to connect > main form updates to logged-in state > other functionality

The problem is that I cannot test the functionality of the connect form and then the logged-in functionality of the program. I can test that it loads the modal connect form correctly; enters the details and clicks OK (all fine so-far) but it does not appear to logically progress the program. The modal form just closes again seemingly without running the connect code from the program back-end and I'm back at the main menu not logged in to anything. I have a feeling that I've either missed something really obvious or that it's simply not doable in NUnit. I have trawled the internet in search of anything similar but the closest was another SO thread that was really generic. Without being able to actually test the logged-in version of the program, I'm at a major hurdle.Another issue is handling message boxes that don't have unique identifiers (e.g. "are you sure you want to exit?"); these also seem to be a major pain in the arse with NUnit(If it makes any difference, I'm running the tests as a stand-alone project using a reference to the executable file of the built project, not the actual source)

View 1 Replies

Winforms - TextBox Validation In .NET And Windows Forms?

Mar 5, 2009

I'm using the following code to validate the text entered by user. It works perfectly fine. But I want to add the backspace feature so as to allow the user to delete the wrongly entered number.I have tried a couple of things and they worked but before last digit (after the decimal point) i.e. it does not allows to delete after the number has been completely entered.number is being entered in the format: 12313213.45

What shall I do?Private Sub TextBox5_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox5.KeyPress

[Code]...

View 7 Replies

Winforms - Word Wrap In Windows Forms (.net)?

Apr 25, 2009

how to do word wrap in drawstring in vb.net 2005.

View 2 Replies

Forms :: Create Separate Parts/winforms Of The Same Application?

Sep 19, 2011

is it a bad idea to create separate parts/winforms of the same application (using the same SQL Server DB) in different executable files. For example for a School IS: A Receptionist App, A Teacher App, A Principal App and so on.

View 2 Replies

Forms :: Run A Command Line Script From Within Winforms Application

Jul 19, 2010

I am writing an application in which a user is doing a file conversion. I have a set of tools that can perform the conversion on the fly via command line, but I'm not entirely sure of how to go about passing the parameters I need to the command line and running them. Can someone point me to the right direction?Would I just create a System.Diagnostics.Process and use that? If so how do I do the line by line command? For instance if I need to issue a cd command to change the directory and then execute a command after that how would I do that?

View 1 Replies

Winforms - Where And When Is InitializeComponent Called In Windows Forms Control

Jun 25, 2009

In C# Windows Forms, a user control's InitializeComponent is called from the form's/control's constructor. When I create same scenario in VB.NET I don't get a constructor, and I can't locate a place where InitializeComponent is called.I need to call my code between InitializeComponent and when the control's Load event is raised, preferably still in the control's constructor. How do I do this in VB.NET?

View 2 Replies

Access A Project's Forms From Another Project #2

Aug 15, 2011

I have two projects: SQLtesting and Controls. Their physical locations are:

[Code]...

View 5 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved