Flexgrid control in vb 6.0 pdf
Really I have no idea. It is not wise to mix old tech with new tech or the end result is what is occuring now. To automatically include the file in your project, put it in the Autoload file. It is simply the DataGridView. From the VBCompatible namespace was told it would be and is removed from future frameworks.
Thank you for your detailed reply, especially the links to DataGridView manuals. I am happy using MsFlexGrid, works fine for me in this application. Time has come to move to DataGridView. Thank you for your reply.
I haven't seen VB Compatable namespace comments about being removed. I read the document detailing changes in VB and it does not list thing that have been removed, it just lists additions. Maybe MS will take this on boardvfor the future?? Be aware there are many posts of sharpies who think that the VB namespace is the compatible namespace. Constant can also have spoken. A constant variables declared with in a procedure can be access only by that procedure.
Constant declared as public can be accessed by the entire application to declare public constants mention public infornt of constant word. Constants declared in a module as public can be accessed by every procedure. Variable type conversations: In some situations you will need to convert variables from one type to another for this VB provides different data type conversation functions. Dim a as Integer. Individual variables can hold single value such as a number data or string.
Arrays hold sets of data in array has a name as variable has and the value stored in array can be accessed by its index. Suppose if you want to store sixteen salaries one for employee. You can declare 16 variables or you can declare an array with 16 elements. An array generally contains series of values which are distinguished by means of index. Declaring Arrays: Arrays must be declared with Dim statement followed by the name of array and the maximum number of values it can hold.
A 0 is the salary of first person; a 1 is the salary of second person and so on. Explicitly you can specify the type of the arrays elements using as key word. Example: Dim a 10 as integer Dim name 10 as string. All the elements now in an array have the same data type.
When the data type is variant for array then elements of an array can contain different types of data. The number that appears in the parenthesis after the array name is called index or upper bound of an array.
For example: Dim salary 16 as integer In these 16 is the upper bound the lower bound starts from 0. The upper bound in 1 less than that mentioned in parenthesis in you can explicitly specify the lower limit of the array. Example: Dim salary 1 to 16 as integer.
Multi Dimensions array:- Single dimensional array stores single dimensional data. Multi dimensional arrays stores data with more than two dimensional arrays has two indices. In such case you can declare dynamic array. To create a dynamic array declare it as usual with dim statement but do not specify its dimensions. Re dimension dynamic user account user is the user enter value which specifies the dimension. The re dimension statement can appear only in a procedure re dimensions statement can change the bounds of the arrays.
But not the no. Forcing variable declaration:- VB does not enforce variable declaration. But for clean coding it is always better to declare variables. This statement tells the compiler to check each variables whether it is declared or not before using it and issue an error message if you attempt to use a variable with out declaring it. If you omit the option explicit. Statement VB creator variables as needed by itself. Let us consider an example following statement converts Germany dollars to US dollars.
Another reason of declaring variable in advances is to simplify debugging in large application. To avoid this application must enforce variables declaration then the compiler complain the DM2 USD variable has not been declared. Procedures: Procedures are useful for implementing repeated tasks such as frequently used calculation. Suppose you are writing an application that at some point it converts centimeters to inches or calculates the smaller of two numbers.
This task in repeated in several places. To repeat in several places a procedure can be writing the same code in several places. The benefits if writing a procedure is it is easy to understand and easy to maintain and the code in clear procedures are of two types. A commands click event procedure is a sub routine which is called each time the button in clicked.
The statements in the sub routine are executed and when the end sub in reached, the control returns to the calling functions. It is possible to exit from a sub routine in between using exit statements.
Sub routine does not report anything to the calling program. The statements making up a function are placed in a pour of functions and end functions. Because functions report a result to the calling program it must have a type.
Sum in a function that returns tomorrow date by adding one day to the current date. Because functions report the result to the calling program, the sum function has a type a date.
Arguments: Argument is a value you pass to the procedure and the procedure acts on it. This is how the sub routine and functions communicate with the application. Key ASCII is an argument which conveys the information about the key pressed functions also accepts arguments and in many cases more than 1. Ex: The function sum accepts two numbers and returns the total of that two numbers. When you call procedure, you must supply values for all the arguments specified in the procedures definition and in the same order.
Call him 10, 15 You can also omit the call statement and call to the sub routine by its name and arguments with in parentheses. Calling functions: Functions are called by name a list of arguments follows the name in parentheses. Argument passing mechanism: There are two mechanism used to pass arguments. When passing arguments by value. The procedure sends only the copy of the argument. Even if the procedure changes the argument value. They are not permanently changed. The advantages of passing argument by value are only the program in which they are declared can change their value.
Now the value n1 and n2 are printed as 10 and This is because the arguments are passed by value. When the argument are passed by value the changes mode to the function argument a, b take effect only with in the function. The value n1 and n2 are not changed permanently. Also returns some value. Function statement. End if. End if 3 Select case. End if: This structure tests the conditions specified and if it is true, executed the statements, specified after the condition.
This is used mainly to test a single condition. End if: This statement executes one block of statement if the condition is true and another if the condition is false. The general syntax is as follows. Another variation of If …. The conditions are evaluated from top to button if any one of them in true. The corresponding block statements are executed and if name of the conditions are satisfied the else block will be executed.
In the above example the expression is day date. The value of that expression is compared with each case value. Some case statements can be followed by multiple value which are separated by , commas.
Looping statement is an important plant of any program. VB supports the following loop statements. Do end 3 For Loop: The Do Once the condition becomes false the loop in terminated. There are two variations of do The general syntax is Do Once the condition becomes false the statements after the loop will be executed. If the condition is initially false. The statements will never execute.
Example: The below Do Do end: The while Once if the condition is false the statements after while Do end will be execute. Control is written to the while statement again which evaluates the condition again this process is repeated until the condition becomes false. The for……next loop uses counter variables that increases or decreases in value during each repition of the loop. The loop in executed until the counter variable reaches the end value.
The counter variable increased by one changing the old value in the loops body will not have any effect to the end value. Once the condition is false the statements after while end will be executed. It has the following syntax.
The general syntax of input box function is: Inputbox is prompt , default , response , y pos , title The above arguments are described as follows: Prompt: If required a string expression this displays the massage us the dialogue box.
Title: It is optional it also requires string expression this displays the title of the dialogue box. If committee the application name is displayed. Defaults: It is optional. This is displayed in the text box as the default value. If no input is provided, it committed the text box is displayed as empty. Response: It is optional it requires numerical expression this specifies the width of the input box.
Y pos: It is also optional and requires numerical expression this specifies the light of the input box. Msgbox function : This displays a message in a dialogue box waits for the user to click a button and return an integer indicating which button the user has clicked. Msgbox prompt button title Prompt: It requires a string expression. This displays a message in a dialogue box.
Button: Button argument is a numeric expression which is optional. It is sum of value specifying the number type of buttons to display. The icon style to display.
The below value shows the constants and its value for the button argument. Constant value Description VB o. VB ok cancel 1 displays ok and cancel button VB abort, retry, syntax 2 displays abort, retry and ignore button. VB yes, no cancel 3 displays yes, no and cancel buttons VB yes, no 4 displays yes and no buttons VB retry cancel 5 displays retry and cancel button VB questions 36 displays warning query, icon VB exclamation 48 displays information message icon VB information 0 first button is defaults VB default button2 second button is default VB default button3 third button is default VB default button4 fourth button is default.
More than one option can be specified in the button argument using plus operator. Each is independent of another. Drive list box: Displays the names of the drive connected to your PC.
The basic property of this control in the drive to be selected in the control. Drive list box or Dir list box: Displays the folders and sub folders of the current drive selected the basic property of this control in the drive path property which sets the drive list box to displays folders and sub folders.
File list box: Displays the file box of current folder. The basic property of this control in path. This property sets file list control to display all the files of the selected folder. If you place all the three controls on a form you can see the names of all the drives in the drive list box. Selecting any of them displays the names of all folders under dir list box control. By double clicking on any one of the folder its sub folders are displayed.
Similarly the file list box control will display the names of all files in the current folders. To force the dir list box to display the folders of the selected in the drive list box you must make sure that each time the user another drive the path properly of the dir list box control must match will the drive property of the drive list box.
The following is the minimum code you must place in the drive list box controls change event. Private sub drive1. Similarly each time the current selection is the dir list box control changes view must set the files list box controls path property to path property dir list box control.
Private sub dir path, End sub. In most cases you may want to limit the number of files displayed in the file list box to do their use the pattern matching property of file list control. It is nice and converts to display the file matching string in a combo box control from which the user can select any one of them.
Changes in combo box are reported to the application using click event. Private sub combo1- click File1. Types of Files in VB Files are organized to facilitate storage and retrieval of data rapidly.
Random access is used when you want to access an individual record as rapidly as possible. You can read one byte at a time, or you can read them in groups. Binary access is mostly used to read or write files that are not to be read by humans.
For effective use of the application, it must: Inform the user of the tasks that are available and Give the user the means to specify the task that is to be performed An application must provide a convenient and consistent way to group commands and an easy way for users to access them. It allows an application to present the user with a means of initiating different actions The Menu Bar : Appears immediately below the title bar on the Form , Contains one or more menu options.
Using too many levels of menus can make the application confusing to the user, Two or three levels are mostly used to design Menus. Visual Basic uses the menu editor to design menus and Most of the control properties can be set using the Menu Editor Menu Control Properties: 1.
Caption: Text that appears on the control 2. Name :Used to reference the menu control from code, Visual Basic does not allow us to exit the editor unless we give each menu control a name 3. Checked: Sets a value that determines whether a check mark is displayed next to a menu item 4. When we type a menu item in the Caption text box, the same item also appears in the menu control list box, Selecting an existing menu control from the list box allows us to edit the properties for that control.
Menus contain a number of options, logically organized and easily accessible by the user. Toolbars supplement the menus by providing quick access to a number of frequently used options.
Yet menus and the toolbars take up little space, they can be made contextual. Menu Conventions 1 Keep Menu captions short and simple. On the Menu Bar use one word for a title. More than one word can be confusing, as there are no separators. Any deviation from the windows conventions will result in confusion.
A list can extend below the bottom, but avoid this if you can. Try to break it up into child menus where possible.
Again remember that too many submenus is a bad design policy. Again, stick to windows conventions. It offers mouse shortcuts for frequently used functions. If you do not have it on your Toolbox, do the following. And Push the OK button and you well see some new controls on your Toolbox.
Now double click on the Toolbar control. A long flat button will appear on the form below the Menu Bar. With the Toolbar in focus click the right-mouse-button.
Select properties from the pop-up menu. Buttons : In this option, you can insert the buttons, set the control keys for the buttons, provide the ToolTip text, etc. Observe that the Image parameter is grayed. Add the buttons that you want. Supply the caption, the key to access the button, etc. The Key that you give here will be the reference you will use when you want to send the toolbar events to menu items. Picture : View the picture of the icons selected.
Multiple document Interface: The MDI was designed to simplify the exchange of information among documents, all under the same roof. With a MDI application, you can maintain multiple windows, but not multiple copies of the application. Data exchange is easier when you can view and compare many documents simultaneously.
The main form or MDI form is not duplicated, but it acts as a container for all the windows, and it is called the parent window. A MDI application must have at least two forms, the parent form and one or more child forms. There can be many child forms, but only one parent form. He parent form may not contain controls. While the parent form is open in the design mode, though the icons in the toolbox are not disabled, but you cannot place any control on the form.
But you can place controls in child forms. To create a MDI application follow these steps: 1. Make this form child by setting its MDIChild property true. To denote that this is a child form set its caption to MDIChild. Double-click your picture control in the tool box. It will appear as toolbar to your MDI form. Place three command buttons on this toolbar and change their names and captions to newchild, cascade and tile respectively. The MDI window will look as in the below. Enter the codes as shown in the below.
Save and run the project. See how you can arrange the child windows in tiles or cascades. You cannadd any number of child windows by clicking the newchild button. A typical tile arrangement of child windows is shown in the below and cascade arrangement of the child windows in the below.
To create an MDI application 1. Create an MDI form. Note An application can have only one MDI form. If no code in these QueryUnload event procedures cancels the Unload event, then each child is unloaded, and finally the MDI form is unloaded. Because the QueryUnload event is invoked before a form is unloaded, you can give the user the opportunity to save a form before unloading it.
Features of MDI Form? In order to display as many documents as the user wants, your application will have to replicate itself as many times. If this were possible, imagine the number of controls, and the code that would have to be loaded in memory. There must be a more practical and efficient way to solve this problem. It is in the form of the Multiple Document Interface MDI 1 An MDI application allows the user to display multiple documents at the same time, with each document displayed in its own window.
Documents or child windows are contained in a parent window, which provides a workspace for all the child windows in the application. The user can start an application, minimize it and close it with a single control , need not close all the Forms. After all functions like adding, displaying, sorting records, etc.
Common controls can be available with the MDI form and share by the other forms. Building User Interface The principles of design that is applicable in most interactive systems.
These underlying principles of interface design Consistency:- Visual Basic offers a host of controls, However, do not make the mistake of using all of them. A number of controls can be used to do the same job. For a particular task have to use the particular control only. Fonts :- The fonts are another area where the designer might run away with his imagination.
Simplicity :- Make sure that the interface you present to the user is simple and easy to use. The interface is the place where you show a concern for the user who is not as knowledgeable about computers as you are. It must be based on the thought pattern of an Average user. Try and think how the target user will accomplish this job.
Provide clues where required without making an overkill. Usability :- The user must be able to use your application with ease. The user is also concerned with the help ,hints and guidance he can get from the applications itself. Images :- A picture is worth a thousand words. Your understanding of the theme will depend upon your frame of mind at the time.
That is the problem of using images or icons to convey a message. Use only those pictures and icons in your program that are universally understood and accepted. What you understand may not be what the user does. Colors :- Use Simple colors. The user is going to be looking at the form that you have designed. Do not have too many colors on your form. When viewed on a color display, some of the colors may disappear. Compile Time Errors 2. Runtime Errors 3. Logic Errors 1. Compile Time Errors: These Errors occurs while writing the code.
They usually occur when the syntax of any visual basic statement is invalid. These Errors are easy to locate and correct. VB checks the syntax of each line of code as you enter and informs you by means of highlighted text. They do not occur until you run your application. Logic Errors: Logical Errors occur when your application produces in correct results.
These errors normally occur due to a mistake made by the programmers. Error Description Syntax Error Occurs when we enter an incorrect line of code such as a mistake in typing a keyword, a punctuation is missing or an incorrectly spelled variable.
For example, using an If statement without a matching End If results in a syntax error. Visual Basic notifies us of the syntax errors before we leave a line of code. Run-time Error Occurs when a command attempts to perform an action that is not valid. For example, a run-time error occurs if we try to assign a string to a numeric variable. Error handlers execute only if a run-time error is encountered. Logic Errors Occurs when an application executes without syntax errors or run-time errors, but the results are not what we intend.
For example, an application might prompt the user for a password but then may not allow access to the application even if the password is correct. This might be acceptable during development and testing phases. So, your code should trap and deal with its own errors.
This statement waits for an error to occur and when the error occurs the error trap statement performs an action written under error handler. On error statement has three forms. On Error Goto Label 2. On Error Resumenext 3.
On Error Goto 1. On Error Goto Label : using this statement in your code, makes VB application to jump to a specific location in your code, if an Error occurs. Errors handle code is always written at the end of the procedure.
This is because in the code, If no error occurs, you must exit the procedure, before reaching the error handler. Otherwise VB executes Error Handling code. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace. Remember Me? Advanced Search. Results 1 to 10 of December 11th, , PM 1.
Join Date Dec Posts 7. Can U help me,Pls give me sourse codes,how to insert data in a FlexGrid using text box. Thank you. December 11th, , PM 2. What is the name of your grid and txtbox?
Welcome to the forums, but we don't just write code. We help you help yourself. December 12th, , AM 3. I don't remember how to write. Insert Data Thank You. December 12th, , AM 4. Attached Files FlxAlignSort.