VS 02/03 With Form Controls Accessible In Modules?

May 15, 2009

Alright, first things first i'm sorta new to VB .NET i know VB6 like no one's business and am looking to upgrade but to do that i need to know how to be able to access form controls in modules, and i've done that, but i'm not sure if its right, here is my code frmMain:

Option Explicit On
Option Strict Off
Friend Class frmMain

[code].....

View 1 Replies


ADVERTISEMENT

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

Create An IMAGELIST In A Main Form And Add To It Then Have It Accessible Within A Child Form?

Mar 22, 2011

I want to create an IMAGELIST in a main form and add to it then have it accessible within a child form. I found several MS examples on database shared access but this is NOT the concept I am after. Straight forward:

Child_Form.<function_to_execute_in_child_form>(The_Passed_Imagelist)

So, within the child form it want to do whatever I like to the IMAGELIST! I have tried passing the object by reference and anything I could think of.

View 3 Replies

Object Passed ByRef To Form, But Not Accessible Throughout Form Class

Feb 18, 2010

Hi

I've got a pretty general question about the best practice in passing an object reference to a Form in VB.NET. My form is a dialog and I've created an overload ShowDialog method, where I pass an Object into it ByRef.

The trouble is, I want to be able to refer to that Object throughout my dialog Class and not just in the ShowDialog method. For instance, some of my Events for controls on the form, need to reference that object.

I know I could create a local Private variable in the Class and assign it to the passed value, and then use that value. However I'm thinking this isn't very efficient because it would (I believe) create a new copy of the Object (which is a complex, large class in itself).

View 8 Replies

Import Modules Form Other Projects

Jul 30, 2010

How can i import modules from other projects

or else i would like to store important functions in modules of any one project and import the codecs into any of my project instead of rewriting

View 3 Replies

How To Make ListBox Accessible Outside Form

Apr 19, 2010

How do you make listbox accessible outside the form it is situated on?

View 3 Replies

Make An Instance Of A Form Accessible Throughout The Application?

Feb 10, 2009

assume that i have two forms(form1 and form2)form1 code

Imports System.IO
Public Class Form1
Inherits System.Windows.Forms.Form

[Code]....

View 5 Replies

Make Variables Accessible To The Entire Form?

Feb 10, 2010

So I am making kinda of wizard, with options and a next buttons all in the same form but using hide and show.I have 3 of them. How can I make variables accessible to the entire form?

View 5 Replies

After Inheritance Of Form A Listbox Is Not Accessible Due To May Be Its Protection Level

Apr 19, 2012

I've got a form with a listbox on it.In a second form I inherit the complete first form. But when I try to use that listbox in the second form with e.g.Index = LstWoodshop.FindString (Order(0))(where LstWoodshop is that inherited Listbox) I get the error message:'LstWood shop' is not declared. It may be inaccessible due to its protection level.What or where can I change this setting so that this listbox on form 1 is also available/accessible on form 2?

View 5 Replies

Serial Port Added In One Form Not Accessible From Another Class?

Apr 19, 2011

I added a serial port com1 to my vb.net form. I created a new class and wrote a method to open the com1 and created its object in the main form and called the method and its opening.THen i created another class wrote a method to write data to the com and same way created an object and called it but i am getting the error as port is closed. What am i doing wrong.

View 1 Replies

VS 2008 Create "modules" As A MDI Form?

Sep 18, 2009

If it is possible, I want to create a file (sort of module) which my MDI-Form can import and see it as a child and adds the name of the child in the menu of the Parent

View 12 Replies

Add Controls To A Form In Code And Set The Properties Of The Controls?

May 24, 2009

How can I add controls to a form in code and set the properties of the controls using the With statement?Also I would like to know how to add a container control and then add a control to that container.

View 2 Replies

Controls Not Return All The Child Controls For The Form?

Apr 15, 2010

I have a slight problem With an enumaration of child controls on a form. The following code will not get but about have the controls that are on the form. The controls show that the count is correct but when it goes through the loop it skips over some of the controls. If you run it through the enumeration two or three times it will get all the controls a few at a time. The solution uses two forms, one that has the controls and the other that labels are made and displayed on. The Tx is just a index to add a number to the label.name and rename the label. So each label is identified seperately. This works for all the the controls that are seen in the for each loop.

View 11 Replies

Pass Usercontrol Controls Or Form Controls?

May 11, 2009

I created a class that can take either usercontrol.controls or form.controls as a parameter,how can i pass either to that class? as a property or how?

View 4 Replies

Accessing Controls Within Controls On A Form

May 26, 2012

I have a module level sub that I use to clear text fields etc on my forms:

CODE:

The problem I have is in the last few lines of code as I'm not really sure how to access the text boxes contained within the tab controls (of which there are many tabs and many text boxes).

This is the closest I've got but I am getting an "option strict on disallows late binding" error on the tabCtl in the following line.

View 6 Replies

Write Controls Text Into A .txt File And Read Them Form .txt File To Controls Again?

Jan 16, 2012

I have a form. And some controls(such as TextBox,ComboBox,etc.) on the form.Now,I want to store the controls' Text into a .txt file(or any other formarts).Then I want to read the text in the .txt file to my controls.

View 10 Replies

VS 2010 Display Pdf File Inside A Form That Gets Some Values From Form Controls?

Sep 27, 2010

Inside a form, I would like to display a pdf file which is already available in my resources (template file "untitled"). In this pdf file, I have some fields which get their values from some texboxes in another form. My aim is, when the user triggers the button to call this form, it should insert the values inside the pdf file and display the output pdf inside the form.I have written the code to an extend but could not finish it myself after my many trials... Now here are the two things I cannot manage:I can use a directory to read the template pdf "untitled1.pdf". But my aim is to use the file inside my resources. can save the output file in a directory but this is not I want to do. I want to display the output pdf.

View 1 Replies

Make Controls On Form Resize When Form Resizes?

Nov 21, 2009

How would i make so when the user resizes the form the controls on the form resizes to what ever(ex: form become full screen textbox is full screen.

View 2 Replies

Controls On MDI Form To Display Child Form?

Apr 15, 2010

I took picture box and some container controls on my MDI form but when I am opening my child forms it going to backside of my MDI forms controls.

How can I resolve this issue because I cannot remove my controls from my MDI form but at the same time I want to use my child form worked properly.

View 1 Replies

Scale Controls On A Form To Fit Form Proportionately?

Nov 30, 2010

I have a visual basic 2010 form with various group boxes, buttons, and labels. i want to be able to have the form maximized but when i do that the controls stay where they are at and they do not resize with the form. i want them to resize proportionately with the form.

View 1 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

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

Hide Both Of The Modules Upon Execution?

Feb 22, 2012

I have finished creating the code for my client/server application although both parts currently execute modules/in console(this was for testing purposes).I am now looking at making both parts of the program completely invisible (they will eventually be executed as a Windows service upon startup). How do i go about this? Does the code need to be copied in to a "Windows Service" project, or is there a way I can hide both of the modules upon execution?

View 5 Replies

.net - Using The Same Modules In Multiple Projects?

Dec 30, 2010

I'm using Visual Studio 2010 and coding in VB.NET.

My problem is that I've collected all the modules I've written and intend to reuse and placed them in a separate folder. When I want to add a module from the above folder to any given project, it takes a copy of the module and places in the project's source code folder, instead of referencing the module in the folder containing all the other modules.

Is it possible to include a module in my project and leave it in the folder with all the other modules, so that when I improve upon a module, it'll affect all the projects that uses/references that module. Instead of me having to manually copy the new module to all the projects that uses/references the module. Right now I have multiple instances of the exact same module that i need to update manually when I improve code or add functionality?

View 3 Replies

.net - Visual Basic And Modules?

Jun 24, 2012

Im writing a application in visual basic to tell the user about their pc.

All this is in a module

Imports Microsoft.VisualBasic.Devices
Imports System.Management
Imports System.Net
Imports System.IO

[Code]...

The problem I am having is that if one of the things in the module fails such as if the users graphics card does not have any onboard memory then it will fail.This is causing everything else to fail aswell.I am very new to visual basic so ifyou could please excuse me if I have made any stupidly obvious errors and any suggestions are welcome

View 1 Replies

Are Modules Used To Organize Code

Apr 11, 2011

I have been brought onto a project where a large amount of code has been written. Most of the code is appearing in the MainWindow.xaml.vb file (yes, this is a wpf project but I think the question is appropriate for this forum). The folks who developed the previous versions in Visual Basic 6 told me that they organized their code by using Modules. I was not aware of this practice and I have actually never even used modules. Can I use modules in this way so that I can logically group different areas of functionality within the application? Or is there a more preferred method?

View 2 Replies

How To Create Class And Modules

May 15, 2009

I am fresher in vb.net but I need some samples on structure which contains fields,method,property and events and if some one help me regarding private,freind, protected freind type class etc. In addition to that I know how to create class and modules but i don't know where I create structure and how etc.

View 1 Replies

IDE :: Modules Window While Debugging

Oct 7, 2009

I have read many many forums regarding the error message "No symbols have been loaded. The breakpoint will not be hit." I had this error message come up a while ago, so I opened a previous version of my project, and copied the newest version of the code I am working on into that project. Then when I debugged, everything worked fine...for a while. Then I got the error message back, so I did the same thing again, and who would have guessed the error message returned, out of the blue. I am working on the program and it works fine, then suddenly one time when I try to debug with a breakpoint I get that message again. So I did some more research and I found a post that recommended looking at the Modules window while debugging (under debug > windows > modules). And in this window under my project, it said "Cannot find or open the PDB file". However, I compared this to the previous version of the program, that works fine, and I noticed that under Path, for my project, the path that I see is not the path where my project is located. So what I am asking is can someone please tell me how to change that path to the correct path where my files are actually located? I believe that if the path is correct, it will find and load the symbols.

View 1 Replies







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