Using Modules - Program That Uses A Tabcontrol - Each Tab Represents A Collection Of Common Tasks

Nov 26, 2011

I have a program that uses a tabcontrol. Each tab represents a collection of common tasks and, as one would expect, has a bunch of controls on it.

In my original version of this app, I simply put all functions/subs/etc related to a specific tab right in the main form class; I just divided them with lines and a few extra blank CRLF so I could jump from section to section within the code (literally named Tab1 Code, Tab2 Code, and so forth).

I am re-working the program and thought I'd use modules for this instead. So, I built all the forms and grabbed the code from the previous version, created a new module, then pasted the code into the module. VB.Net 2010 has choked all over this with a zillion errors. The functions/subs are all public, but they cannot see any of the controls on the main form. Every control that is in existence on the main form comes up as being not declared in the module.

This is the first time I've tried to use a module without a full class, and the first time I've tried referencing back to controls on the main form in this fashion (I've always just used it for functions/subs that I pass data to). Am I trying to do something here that shouldn't be done or...? I basically just want to create files so I can segregate the code into a more logical design.

View 4 Replies


ADVERTISEMENT

Moving Modules/classes/forms To A Common Folder?

Nov 23, 2009

I have two projects

a.sln and b.sln they have their own classes, modules and forms.

As I work on solution 'A' I devise a class and save it in solution A's folder. As the class develops, I now find a need for it in solution B.

How can I move it from solution A's folder to my Common folder then link it into solution A and B.

Currently I am doing this manually, Moving then linking to it. Is there a way to do this withing the IDE

View 14 Replies

Write An Application That Performs Common Systems Tasks From A Single Location?

Feb 26, 2010

I am wanting to expand my programming knowledge base and the only way I know to do that is to actually do stuff. I am wanting to write an application that performs common systems tasks from a single location. Just simple things like deleting text files, maybe displaying drive space, etc. In order to even begin to do this I have to understand more about the my.computer class in VB. Does anyone have some good info that breaks this class (and possibly related classes) down hierarchically? MSDN offers a lot of info but doesn't really give a lot in the way of explaining how certain classes are interrelated.

View 5 Replies

Get The Data 'less Common As Possible' From A Collection?

May 15, 2011

Starting from a table like this:

| Code | Year |
---------------
| A01 | 2001 |
| A01 | 2002 |
| B01 | 2002 |
| C01 | 2003 |

I have to arrive to this:

| Code | Year |
---------------
| A01 | 2001 |
| B01 | 2002 |
| C01 | 2003 |

I have to group the first column (Code) and from the second (Year) I have to get the data 'less common as possible' compared to all the other records. I try to explain this with the example: for the code 'A01' I have 2 years: '2001' and '2002'. I have to take '2001' because it's the one that not recurs in the other records. In the case that there aren't available values 'Year' that not recurs in the other records, it's good to take whatever value.

The data are in the form of array in memory and to interact with them I'm useng some LINQ queries.

View 4 Replies

IDE :: Windows Forms Classes Appear As Class Modules Not Form Modules In Project Explorer

Jan 7, 2011

Yesterday I opened Visual Studio (2008 v 9.0.30729.1) and all the winform classes in my project display with class module icons with the little 'VB', instead of form module icons with the little form icon!

When I double click on a form module, the form designer doesn't open, just the code module.

When I run the project, it runs fine. There are no errors. The project builds fine.

I did Project --> show all files, and I can see the designer and resx files below the form module which doesn't look or act like a form module.

I can't open my forms to design them!

View 1 Replies

VBS Script - Delete All Scheduled Tasks Which Start With "My Application Tasks

Mar 19, 2010

Ineed a VBS script that removes all scheduled tasks which start with a specific string.

For example, delete all scheduled tasks which start with "My Application Tasks..."

I wanna use this VBS script in my application uninstaller so all tasks created by my application are removed at the uninstall time, however am not familiar with VBS.

View 1 Replies

VS 2008 How Many Modules Can Have In One Program

Sep 8, 2009

I am doing a VB.NET course, there is a question in one of my assignments - "How many modules can you have in one program?" This seems like something that should be easy to find, but I have not been able to find it anywhere.Can anyone direct me to a resource that would have this? My initial thought is unlimited, although in practical terms, if you have an excess number of modules, then you probably need to re-think your workflows.

View 3 Replies

Are Modules Still Commonly Used In Program Structures

Aug 18, 2010

I am not a program designer by any means but I would really like to start getting a better grasp of how to do it and a better understanding of the .NET languages in general (VB, C#). I was reading a book by Wrox - Professional Visual Basic 2008. In it I believed it mentioned that Modules are slowly going out of existence. I can see why most coding would go into a class object but I would assume modules would always be necessary to at least keep the code clean.

Also, I have been searching for a good source on software design but I can't seem to find any recent books published. I might be searching in the wrong places but I would really like to get my hands on one.

View 4 Replies

Program Locking When Performing Some Tasks

Feb 3, 2011

I have a program that has the option to create a restore point. My problem is that when you click on it to do so, the program just locks up until it's finished creating the restore point. I have put a separate form on the program and it has a Marquee Progress Bar Control which I downloaded, so the idea is.

User clicks "Create Restore Point"

frmRestore.show
Marquee Progress Bar goes on and on while the restore point is created
Restore point is done
frmRestore.hide

The thing is, when you click create restore point, the form shows and the program just locks up, onces the restore point is created the form hides again. Could this problem be solved with a Background worker? To be honest I'm not completely sure what it does, I mucked around with the controls but can't seem to find anything useful.

View 3 Replies

Program Locking When Performing Some Tasks?

Nov 23, 2011

I have a program that has the option to create a restore point...My problem is that when you click on it to do so, the program just locks up until it's finished creating the restore point.

View 13 Replies

Creating Modules For Program (Similar To Firefox Add On)

Apr 7, 2010

I have a contact manager program that I'd like to design for multiple network marketing companies. My desired structure would include a core program which covers basic contact management functions. After that one could purchase a module for their specific network marketing company. This module would contain a variety of controls that the original program would need to be able to manipulate. Here is an example of what it would have to have:A group box containing buttons that link to a genealogy view, and the option to import one's donwnline from the back office provided by a company.A panel which is displayed on the contact page allowing the user to input business information or which will be filled by importing a downline from the back office: ie business ID, qualification level, sponsor information etc.a panel displayed when one searches for contacts on the contact list page which allows the user to sort based on information such as when they joined, what their business id is and so forth.a panel which is displayed in a personal business overview page which presents to an individual how many people in their downline are at each qualification level and develop a mailing list for individuals of a certain qualification level.

I have the code developed to perform all these functions, I just wanted to give you an example of what needed to be done. I'm thinking that what I'm trying to create is a library that one can download and the program will recognize, but I'm not really sure where to go. What I'm really trying to do is figure out what kind of file I can make that will contain all this code and the GUI information that the program will recognize.

View 2 Replies

Start Learning/using Modules Instead Of Integrating The Code Directly Into The Program?

Jun 22, 2010

I want to start learning/using modules instead of integrating the code directly into the program. So, I tried to make an example. Basically, what I wanted the program to do, is I click button1 and it lists details about my computer. So, I added 7 labels to the form, and a button. Then, I added a module (Module1.vb)

[Code]...

View 8 Replies

Import Common Block To Program?

Apr 18, 2009

I'm writting a dll in Fortran. I've included some common blocks in the fortran code. And I don't khow how to import it to Visual Basic.

View 2 Replies

Same Program Sharing Common Datafiles?

Dec 15, 2011

I'm back to working on my program and need a little advice. I have this program on two computers and I want to set it up to access the same set of datafiles. I want the program to tell it's counterpart on the other computer that it has a certain file open so the other program will not allow that person to access the opened file. The data files are all text files. Without using SQL or outside apps, can this be done thru vb.net?

View 11 Replies

Forms :: Listbox - Program That Takes Common Applications And Installs Them Silently Using Batch Files

Aug 21, 2010

I'm making a program that takes common applications and installs them silently using batch files. Someone would select the programs they would want to install and my program will write a giant batch file and execute it to install whatever they want. Heres the problem, After the user selects the programs they go into either one or two lists. Non Silent Installer List Or Silent installer list.

Some programs I have simply won't go silently so from there they can choose in what order they want to install these programs. Then there is a combo box that tells weather you want to install non silent programs first or last. From there you hit add to batch file and it would add everything in listbox1 and listbox2 in order. Listbox1 would contain just the text "MalwareBytes" for example. Along with Novell Groupwise and Firefox. How do I get that to add to the Batch List as a code and in order? So the user wants Malware bytes added first to the batch file. How do I add that to my batch list as a completely different code?

[CODE]..............

View 8 Replies

VS 2010 - Array SubString (of Sorts) / Making A Class That Represents A File?

Feb 24, 2011

Im making a class that represents a file. Im making a sub that reads data from one byte array into many properties. Now i need something that returns a byte array but only the first 4. Let me demonstrate because i can't think of a logical way of explaining. "something".substring(0,3) That would return a string containing "som" i need a function like that for a byte array


[code]...

Is there an existing function for this type of thing ? i've looked but didn't see anything that I understood.

View 2 Replies

Coding A Button That Calculates A Set Of Label Answers And Represents A Percentage Answer In A Different Label?

Feb 19, 2010

Private Sub uiSCORE_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles uiSCORE.Click
'Displays Correct or Wrong in Labels
If ui1Textbox.Text.ToUpper = "FOOD" Then[code]....

I finally finished all my labels and textbox codes for this button.But now I have to code it so that I will be able to click the button and it will calculate all the wrong and correct answers in the labels and then finally place the percentage score in the uiScorePercentagelabel. What I dont understand is how to calculate all the different labels as one and then show the percentage right in the appropriate label.

View 6 Replies

Get Key And Value From A Collection Program?

Sep 21, 2011

How do you get the key value from a vb.net collection when iterating through it?[code]...

View 2 Replies

Convert Collection.foreach From C# To Program?

May 12, 2009

In C# i just put the method in the parentheses that i want to run on each row of the collection, but it isn't working in VB.NET.[code]...

View 1 Replies

Data Management Program - JIT Collection Was Modified

Dec 21, 2011

I'm have a data management program. I've fixed everything in it, except when I run my Insert or update commands on a different computer I've installed it on, JIT tells me that the collection has be modified, it then gives me the option to continue or quit. I know it's been modified, the user knows it's been modified, how do I get rid of that?

View 10 Replies

.net - Storing Subcollections (filtered Versions Of The Main Collection) Inside The Collection As Cache?

Jan 15, 2010

Is it good practice to store sub-collections of item X inside a parent collection of item X for caching 'filter-queries' which are performed on the parent collection? (They won't be used together (as in color AND type).) Or is it also ok to just Loop over the collection and return the correct entities in a temporary collection?

[Code]...

View 1 Replies

C# - Edit List Collection : Error Note Collection Was Modified - Enumeration Operation May Not Execute?

Sep 7, 2011

I have the following classes:

Product, Service and OrderItem

Product and Service must inherit OrderItem. So basically I want to store OrderItem object in my shopping cart and these object are store in a list.

Public MustInherit Class OrderItem
Private m_enuItemType As TypeOfItem = TypeOfItem.None
Private m_strUserID As Integer[code].....

View 1 Replies

Make A Custom Collection That Take Advantage Of The Collection Editor?

Feb 8, 2010

I have been researching for a couple of days now and to no avail. Does Anyone know how to make a custom collection that take advantage of the collection editor? I would like to be able to have 3 Color Values, 1 Boolean and 1 String.

View 15 Replies

Are Modules The Same As VB6 Bas Files

Aug 22, 2010

using bas files in visual basic 6 because I could write functions or subs that I would just easily use over and over rather than keep rewriting code. Do these work in the same way in .net? If anyone has any good info on modules like how to start writing functions and subs. Assuming of course that they work like vb6 bas files. If I were to make this sub a function how would I do this and I am assuming the benefit of this specific example would be a Boolean to check if if saved the text file or not?

Code:
Public Sub SaveList(ByVal List As ListBox, ByVal filename As String)
Dim i As Integer
Dim w As IO.StreamWriter

[code]....

View 1 Replies

Save Log Of Tasks?

Jan 24, 2012

My program performs a bunch of task in a loop. After each task completed it saves log/status of task in a text file. The program runs fast but if there is more than 10,000 tasks it becomes slower and it takes a lot of CPU because of frequent I/O operation.

Is there a better way to save the log/status of task without making the program slower? At first i used a textbox control to store the log but the problem is textbox control can not hold a lot of text.

View 2 Replies

Threading Tasks In .net?

Sep 23, 2010

how the threading within vb actually works. am i of the understanding that every time you create an event, through a button control for instance, that this infact creates a seperate process which will run independantly to another. say for instance you had two buttons on a form and each contained code which took 5 seconds to execute. if i were to click one button into action and then the other with a second, would the two processes run alongside one another or would i have to wait for the first code to execute before the second button could be executed?

View 13 Replies

Using Modules In .NET Considered?

Jun 7, 2011

During the design of a new application I was wondering if using a module with properties is considered to be a bad practice. Some example code:

Module modSettings
public property Setting1 as string
public property DatabaseObject as IDatabaseObject
End Module

The code above is just an example to emphasize my question. In the past, this structure was used a lot in VB6. In the past I used it as well in my .NET projects.

But nowadays with buzzwords like Dependency Injection, Testability and Separation of Concerns the above structure smells bad. I can't really describe why, but it just feels wrong. I must admit I'm not very familiar with the keywords above, yet.So I'm wondering whether the above code really is a bad practice. If so, what would you use a Module for?

View 4 Replies

Using Modules Rather Than Classes?

Apr 15, 2010

What advantage is there, if any, to using Modules rather than classes in VB? How do they differ, and what advantages/disadvantages are there in using modules? In VB or VB.NET, I use both.

View 3 Replies

VS 2010 - Modules - Add Something Behind Sub

Oct 9, 2009

I created a module named Sample, in it i made a Public Sub called Sub. But how do i do to add something "behind sub", so i can write like this:

Sample.Sub.alternative1
Sample.Sub.alternative2
etc.

View 5 Replies

.net - Collection Initializes For Read-only Collection Properties?

Jul 25, 2011

I'm trying to support Basic.NET on my framework so I'm trying to convert C# 4 code to Basic.NET 10. Microsoft is committed to "co-evolve" these two but I'm having a problem with collection initialization... I found that I can initialize a collection much like in C#:

[Code]...

View 6 Replies







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