473,811 Members | 3,356 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I make a class for a button? I need multiple buttons based on items retrieved.

8 New Member
I am working on a program where I need to read files. I won't know how many buttons I need until run time. I can't figure out how to create a button class I can call at run time. Each button will represent a file. I want each button when clicked to open the correct file and place the data into a rich text box on the form.

Also, I need buttons to appear tightly in a row or multiple rows.
Dec 28 '10 #1
2 1368
David Gluth
46 New Member
1. Use a FlowLayoutPanel . Place this control on your form as you would a panel or groupbox. This is where you will put your buttons. It will allow the buttons to line up side by side or top to bottom as you set it parameters.
2. In code for each file you will create a new instance of a button (dim myButton as new button), override its click event handler to point to the sub routine that will handle that input file.
3. Add the button to the control - Me.flowLayoutPa nel.controls.ad d(mybutton)
Dec 29 '10 #2
Audie7734
8 New Member
Thank you David. I was thinking I needed to create a seperate class. I forgot about (Dim myButton As New Button) You answered all my Questons, Thanks again.
Dec 30 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
4428
by: Matt | last post by:
How can I implement multiple buttons for a form like - submit, cancel, logout etc. Thanks. Matt
2
1861
by: Matt | last post by:
The ASP page has multiple buttons, and when the user clicks different buttons, it will submit the form data to different URLs. My first approach was to use BUTTON type, and triggers javascript function to submit the form data. However, it didn't work properly and I changed to use SUBMIT type. <INPUT TYPE="BUTTON" NAME="action1" VALUE="Return to Main Search Page" onClick="action1()">
0
915
by: Ricardo.PT | last post by:
Hi all, I want to hide/show buttons based in a query that I pass to my form via webservice with a dataset populated. Problem is when I try to hide/show myButton I have a Invalid Cast Error, anyone can help me? TIA -- MyCode Dim myButton As Button Dim myTable As DataTable = dsTemplateWebSecurity.Tables(0)
5
5481
by: Ron Brennan | last post by:
Good afternoon. The entire task that I'm trying to achieve is to allow a user to browse and upload multiple files simultaneously, hiding the Browse button of <input> tags of type="file" and replacing it with a button of my own background color and text. The file paths I'd like displayed in a textarea and then the files uploaded at once.
2
3258
by: D | last post by:
Most of my web forms have multiple buttons (Proceed, Back, link buttons for various screens, etc.) It looks like, say a required field validator for example, gives me an error message no matter which button is pushed. Well, the user simply wants to navigate to a different screen without filling out the form. So is there a way to tie validation controls to specific buttons?
2
2884
by: B Garner | last post by:
Hi all Help please. I would like to automate the printing of a report. The report actually is a single page and prints a label. I would like to be able to print the report multiple times based on the value of the items field. I have a command button which opens the report in the print option. This works fine when there is only 1 item.
0
2189
by: Rich | last post by:
HowDo I script multiple buttons on one scene/frame all with different scenes? Like a menu bar across the front. Please help
0
1256
by: fperri | last post by:
Hi, I'm doing my first site in ASP.net. I have a form that has two list boxes where they can select a value in one and click a button to select and it moves it to the other listbox. I got this to work ok but once I finished the form and added my required field validators when the select button is clicked I get an error saying; Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in...
5
1743
by: pgrazaitis | last post by:
I cant seem to get my head wrapped around this issue, I have myself so twisted now there maybe no issue! Ok so I designed a class X that has a few members, and for arguments sake one of the members Y is the location of a file to be read. The original design assumes that this class will be instantiated and each instance will happily mange its own members. (ie One file location per instance...no thread-safety). Now another class A...
3
5028
by: Vinda | last post by:
Hi Bytes, Using a previous question as a base Access 2000 Inserting multiple rows based on a date range. I also wanted to insert multiple rows into a table according to a date range supplied by a user (eg txtRDateStart & txtRDateEnd). The script was envisaged to be able to also gather a time and text description that would be repeated within each row. For example: The user would enter... Start Date: 13/03/2010 End Date: 17/03/2010...
0
10644
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10393
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7664
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6882
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4334
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3863
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.