VS 2008 Form/BLL Communication, Best Coding Practice?

Apr 18, 2010

Question is related to rather simple programs typically presenting some data in a few datagridviews, charts etc. And consisting typically of a main form and one or two settings forms.I'm trying to program in a layered structure, pulling every bit of code out of any form class, and having a seperate "program class" for any form that I make. Now.. So far you can't complain on that I guess, but how to do this in best coding practice? In the form class I make a member object of the program class, hence making the program class a child of the form. Now I'm able to create events in the child class, and have handler methods in the form, without writing delegate classes (it seems). Now, that is fine, as it enables me to update the form controls with such events happening in the program class. However, how do I send events the other direction, from the form (parent) to the program class (child)? I guess I don't have to use events, I could just use the member object to access public methods in the program class directly, with passing of parameters from the form controls.. however, is that good practice? Or should I use events also that direction, and how to make that work, do I need to introduce delegate classes

View 21 Replies


ADVERTISEMENT

VS 2008 Any Coding For Which It Disables Entire Form Until Process Is Completed?

Jul 23, 2009

My form contains lots and lots regular expression and other things in one button. whch when pressed takes some time to process.. so the form kind of gets stucked while the processing is bieng done.is there any coding for which it diables the entire form until the process is completed? like disabling the entire form and showing a text "please wait ... processing data" so user can not use other buttons or features at the same time or it might get crashed.

View 5 Replies

Inter-form Communication - Form Being Called Form Several Forms Using ShowDialog()

Mar 28, 2011

I have a form being called form several forms using ShowDialog().

1. Is there a way for called form to know which form called it by receiving a code or key from the calling form?

2. The calling form has a gridview. How can the called form pick up a column's value from the currently highlighted row in gridview in the calling form?

View 4 Replies

VS 2008 - Best Practice For Loading Image In PictureBox

Mar 31, 2009

Just want to know the best method to load a picture in a picture box dynamically. As part of my development, I was supposed to load 4 pictures from network to 4 picturebox controls.

For which, I found, 2 methods.
1. Picturebox1.Image=new bitmap("C:\test.jpg")
(or)
2. Piturebox1.ImageLocation="C:\test.jpg"
Which one is more suitable interms of performance.

View 9 Replies

VS 2008 - Best Practice For Using Option Infer Feature?

Mar 20, 2009

What do you feel are best practices for the use of Option Infer in your projects? In Visual Studio 2008, Option Infer is a directive that allows the compiler to infer the datatype of a declared variable by looking at what is assigned to it. This is a key feature in VS2008 and is used extensively with LINQ statements and queries. However, turning on Option Infer may create pitfalls for future maintenance programmers.

View 5 Replies

VS 2008 USB Communication?

May 9, 2010

I made a device (it's a remote-control your computer thing). Is it possible to interact with it using USB & VB.NET? If so, how? I've looked around and it doesn't seem to be part of the framework, but maybe there's some API I could use? I could always use serial ports, but I don't really want this device to require a battery. Is it possible, and if not, is there another way I could do this?

View 16 Replies

VS 2008 Using TCP Communication For IM?

May 13, 2009

I am currently using the code from this thread:Click Here Using the code how would i allow the user through the client to send a message to the server which specifies the user the message is intended for as well as the message. I know how to send messages as there is a function for that in the code supplied in the link.Though how do i associate usernames with each client? As i saw a username property has been created in the code but how do i use it for the purposes i want?

I also need to be able to test the username and password fields for a login system..

View 12 Replies

Coding For Windows Form?

Jun 21, 2010

i'm a newbie in vb.net. i've already design a form as per attached. but i got problem in making the button function as what it should be. the navigation button..the add, edit , delete button...all the buttons...the save button is situated under the add button.

View 1 Replies

VS 2008 : Communication Between .net Programs?

Jun 15, 2011

I have a Windows Form Application which has been developed in vb.net 3.5. It is a charting program and shows stock market charts to users. Now I have made another program in vb.net (same .net version) and I want this program to interact with the one I made before. The new program is like a small scripting language. So for example: if I run a script then its output should be reflected in the other program. How can the two programs communicate ? Both will be running on same systems. No remote stuff. I mean passing arrays,strings or possibly structures.

Plus I have several functions which are written in first program. Is it possible for the other program which is an .exe also to call the functions of the other one if I make sub/function public or something. The reason is we can calls functions or subs if we include a dll. But can one exe calls functions/sub of another exe (if both program are in .net).

View 10 Replies

Fill A Form Of A Web Page Through Coding?

Aug 5, 2011

I want to fill a form of a web page through coding.while filling one field example city: if i type more than three words, it shows a drop down list which are mathcing for typed words. How to capture that data through coding.That is like as below, when i am viewing through view->source

Sys.Application.add_init(function() {
$create(AjaxControlToolkit.AutoCompleteBehavior, {"completionSetCount":20,"delimiterCharacters":"","firstRowSelected":true,"id":"ctl00_cpMain_AutoCom

[code]....

View 1 Replies

Get Search Coding Form Database?

Jun 22, 2010

search button coding in vb.net

View 1 Replies

Serial Communication Using Threading In 2008?

Jul 5, 2009

how to do serial communication using threading in vb.net 2008,

View 1 Replies

VS 2008 - Communication Between Programs (Tag Property)

Apr 19, 2010

Is it possible to get the Tag property of another .NET form running in a seperate process?

View 11 Replies

VS 2008 Communication Between Separate Applications?

Dec 7, 2011

I'm thinking of creating some applications that will process search and storage requirements.

I want these to be separate applications - so that I could eventually move them to different servers for scalability.

What methods are available for me to have these app's communicate with each other?

View 4 Replies

Coding In Excel Creating A User-form?

Mar 1, 2009

I've created a User-form in excel and I need help in the coding part of it.Currently I have coded the User form, as shown below:

Option Explicit

Private Sub cmdAdd_Click()
Dim ws As Worksheet
Dim r As Integer[code].....

The section which says 'Find first free row from A21' up to'Cells(r, 4).Value = Me.txtQty2.Value' (highlighted in bold) is where I need help. I currently have 3 combo-boxes called 'cboProduct, cboProduct2 andcboproduct3' and next to each one of them I have a textbox called 'txtQty1,txtQty2 and txtQty3'. I am trying to get the first combo-box to find the first free row starting from A21 and go to cell B21 and the first textbox to go to D21. For the second combo-box to find a free row from A21 and go to B22 if B21 is used and the same applies to the textbox , if D21 is used to go D22.This also applies for the third combo-box and text box. However my coding doesn't work.

View 1 Replies

Dynamic Coding - Add A Control At Runtime To A Form?

Nov 3, 2009

I know hoe to add a control at runtime to a form, what I would like to know is if there is a way to add code programmatically at runtime as well?

[Code]...

View 2 Replies

Make A Validation Code For ASP.NET Form With VB Coding?

Feb 16, 2012

im trying to build a form+attachment that needs to be send to email.Im using a VB background code (attachementemail.aspx.vb)and my front (b-16.aspx) I want the page to check that the user entered a email, name, phonenumber and attachment. what command do I put in the axp.vb and what on the .aspx tried just about anything.

View 2 Replies

Communications :: Client-server Communication Program - Click On CmdListen In The Server Form And CmdConnect In The Client Form

Jul 23, 2008

The problem I have is: When I click on cmdListen in the server form and cmdConnect in the client form,both programs won't respond and they crash for some reason I don't know.

Client source code:

Code:

Imports System.Net.Sockets
Imports System.Text
Public Class Form1

[CODE]...

Code:
Imports System.Net.Sockets
Imports System.Text
Public Class Form1

[CODE]...

View 3 Replies

Coding My Groupbox Radio Buttons To Invoke A Form

May 7, 2009

I am trying to code my pet age calculator form to allow user interface for the user to choose feline or canine, choosing the ok button will then invoke the frmCanine or frmFeline, can anyone work with me on this?

Public Class frmPetCalculator
Private Sub rdoCanine_checkedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rdoCanine.CheckedChanged

[Code].....

View 3 Replies

VS 2010 Coding Arrays For Form With Listbox And Textboxes

Oct 12, 2011

I have a form that has 1 listbox and multiple textboxes. I need to write an array code to beable to select on an item in the listbox and then display different data into the multiple textboxes due to what is specifically chosen in the listbox. Im having a lot of trouble figuring this out.

View 5 Replies

VS 2008 - Sending Data From Client To Server (No Communication)

Oct 13, 2010

I'm not sure what I have done wrong, I am trying to get my program to send data (UsernamesPasswords) from client to server, then the server says if it's right or wrong.

The error is on this line:
Dim networkStream As NetworkStream = TcpClient.GetStream()

Heres the Client:
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text = "" Then
MsgBox("You must enter UN/PW!")
[Code] .....

View 4 Replies

Write Using Visual Basicprogram 2008 (for Serial Communication)?

Mar 22, 2011

I am working on a porject that interlinks a PC and PIC using the USBtoUART programmer for Serial Communication.

I have just started using and reading the Book on Visual Basic 2008 Professional and read the book by ROD STEPHENS <VB 2008> Programmer's Reference.

However, I would like to know where should I start working from?

I personally want to start from building the Visual Basic interface that enables serial communication between PC and the USBtoUART converter.

View 2 Replies

Hard Coding Vs Soft Coding

May 7, 2009

Say we have a DataGridView on the main form. I can chose to establish its properties by code or by selecting them in the Properties panel. Is there a difference between these two techniques, a loading time penalty in any of the cases especially?

View 5 Replies

Visual Basic (Coding) - Child Form To Open Within A Panel On Its Parent?

Mar 2, 2012

I have created a (kind of) 'Desktop' Form for the main basis of my program. Basically it is made up of 3 panel controls.

1. Holds all buttons which load the different forms (Like the windows start menu when expanded). name: StartMenuPanel

2. Holds Information on log in deatails. name: LogCheckPanel (very thin panel at top of screen)

3. Main panel which takes up the majority of the screen (where I want the forms to load). name: MainPanel

My aim is: When a button is clicked from the 'StartMenuPanel' the form will load with-in the 'MainPanel'.

I tried changing the start position to 'centre parent', but the panels are in the way so some of the childform is overlayed by the panels.

[Code]...

When I run this I get the following error: 'Top-level control cannot be added to a control'.

I hope I've explained this well enough.

View 7 Replies

VS 2010 : Coding A Save Button And Combo From A Form To Work With A Access DB?

Feb 23, 2011

I am a bit stuck with coding my save button and combobox.My entire form is ready, database is linked.All fields from DB are linked to their textboxes on the form.But i just ran into a big wall which i cant seem to break down.My save button, which is used to save the content from all the textboxes on the form to the access database refuses to work.The other this is, i want to use a combobox on my form to view the already saved entries in the access database.I think a combobox works for that, but i am not exactly sure how to pull that one off.

View 5 Replies

VS 2008 Tic Tac Toe Coding?

Apr 22, 2009

I Have a project to do for the class and i start to do it but i am not able to do the last part which is ( if there is no win, it should say drew) i do not know how.lp me on that and if you can give me easier way ti am using visual basic 2008 express.here is the codeode

Public Class Form1
Dim player As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles

[code]...

View 2 Replies

VS 2008 Api Response Coding?

Aug 10, 2009

I have developed an application for Windows Mobile Devices using Visual Basic 2008. One feature of the application, allows users to view records that are stored online, on the device. The application sends encoded data to an API, which is simply part of a server. The process I am using to send the data to the API is extremely simple. When you press the "Send" button in the application, it pulls the information needed, encodes that information in base64, and then attaches that information to the end of a URL. For example, it would look exactly like this when it was ready to send.

[URL]

The data is then sent out by simply loading it into a webbrowser control. Once the data hits the API, the API Then sends a response back. And this is where my issue is coming into play. The API either sends a message back saying "Pass" or "Fail". If it Fails, It includes and Error Message. If it passes, it includes a "URL" which then has to be opened in a browser or in a webbrowser control.

I need to know: HOW DO I CAPTURE THE RESPONSE THAT THE API IS SENDING BACK. More Specifically, I need to know how to capture the URL that is being sent back from the API, so that I can open it in a webbrowser control.

Now, I feel like I need to be more specific as to what is going on. I am able to send the data to the API, and it is being sent exactly as it needs to be. It has been confirmed on the API side, that the response is being sent back to me. The only problem I am having, is trying to figure out what to do with the response, more specifically, how to view the response period. I'm extremely new to the entire API Deal. Without being able to view the URL That is being sent back, the feature doesn't work of course.

MY CODE I HAVE SO FAR:

Public Function VARRecEncode() As Object
VARRecEncode = p1 & AccessPin
TextBox2.Text = VARRecEncode

[code]....

View 1 Replies

Coding For Next And Previous Button In .net 2008?

Jun 5, 2011

This is my coding for button Next and Previous but when I click on next it just goes to next like from pictures 1 and 2 to pic 3 and 4 but not any more because i have pictures in two imagelist upto 20 but it doesnt work and the coding for button previous also doesnt work same problem.

Next Button Coding
Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
Static imagenumber As Integer
Try

[code]...

View 2 Replies

VB6 To .NET 2008. Converting Design Before Coding?

Feb 2, 2011

i have to get this off my chest.Forgive me... I'm a relative newbie stuck in the vb6 world because of my job.vb6 to vb .net is a huge change in the way one has to program (and to think). I never could figure out the big picture of things with .net.Everything is a class..? What's with all of this... Class this, Interface to a class, inheritance (of classes) here, casting? polymorphism.

As a newbie to vb.net (I use 2008)... I just wanted to say this out loud and see if i can even get my terms correct. Vb6 is a good language for beginners but not a real professional language and (vb6) is effectively a watered down, lazy man's (quick and dirty) way of creating programs to solve some particular task.

[Code]...

View 6 Replies

VS 2008 VBNET2008 TreeView Coding?

Jan 29, 2011

The Sales Manager requested the customer Order transaction to be display like Windows Explorer.I am using TreeView controls and having problem doing the coding as I have not done it before.Listed beow are the SQL String and the result of it. And also the display on TreeView.

SQL String :
SELECT OrderID, OrderDate ProductID
FROM Invoices WHERE (CustomerID = N'Chops') Order by OrderID, Orderdate

[code].....

View 2 Replies







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