By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,780 Members | 1,126 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,780 IT Pros & Developers. It's quick & easy.

Visual basic 2005, table layout

P: 6
I created a program where the user can click a button that will add a button into the table layout.
I was wondering if there was a way/code that can enable me to give the new button functions for when the user clicks on it?
Nov 16 '06 #1
Share this Question
Share on Google+
11 Replies


100+
P: 1,646
I created a program where the user can click a button that will add a button into the table layout.
I was wondering if there was a way/code that can enable me to give the new button functions for when the user clicks on it?
Hi. What you can do is create the button plus code beforehand and set the buttons visible property to false. Then the user can, apparently, create a new button which is the already existing button which you make visible.

Hope this helps
Nov 16 '06 #2

P: 6
I tried,but i just couldn't get it to work.

Would i be able to give my code to someone for them to fix it?
Nov 16 '06 #3

Expert 5K+
P: 8,434
I tried,but i just couldn't get it to work.

Would i be able to give my code to someone for them to fix it?
If you post it here, lots of people can have a look at it. Whether they can fix it, well, you never know until you try.

Personally, I'm confused about what you are referring to by the term "table layout". (I'm an old VB6 developer, and may just be out of touch).
Nov 16 '06 #4

100+
P: 1,646
I tried,but i just couldn't get it to work.

Would i be able to give my code to someone for them to fix it?
Looks like you are working on a web page.
Please post the code.
Nov 16 '06 #5

P: 6
I'm sorry but I solved my question, although i so have another. I also decided not to post the code in regards to the first question.

Q#1
My new question is
Is there a way to save data, what variables and labels are, along with what picture, a picturebox is currently on.

Q#2
Is there a way to disable the "X" button in a form's window?
Nov 17 '06 #6

Expert 5K+
P: 8,434
Q#1
My new question is
Is there a way to save data, what variables and labels are, along with what picture, a picturebox is currently on.
Could you try to explain in a little more detail what you want to achieve here? Maybe I'm just a bit slow, but I couldn't really follow the question.

Q#2
Is there a way to disable the "X" button in a form's window?
In VB6, you can do this by turning off the .ControlBox property of the form. I don't now what the equivalent would be in VB2005.
Nov 19 '06 #7

100+
P: 1,646
I'm sorry but I solved my question, although i so have another. I also decided not to post the code in regards to the first question.

Q#1
My new question is
Is there a way to save data, what variables and labels are, along with what picture, a picturebox is currently on.

Q#2
Is there a way to disable the "X" button in a form's window?
Hi. Looks like you are committed to not posting any code or work that you have already done. Have you written any code?
Nov 20 '06 #8

sashi
Expert 100+
P: 1,754
I'm sorry but I solved my question, although i so have another. I also decided not to post the code in regards to the first question.

Q#1
My new question is
Is there a way to save data, what variables and labels are, along with what picture, a picturebox is currently on.

Q#2
Is there a way to disable the "X" button in a form's window?
Hi there,

In your earlier post you mentioned that you have created some kind of program that allows button to added into table layout upon clicking of another button. In your second post you have asked 2 questions respectively. Agree?

My question is, how was it possible for you to create such a "complex" program without even having an idea of what are variables & labels?

Very well, correct me if i was wrong, i feel variables & datatype related understanding are the basic for almost every programming language. Correct? Don't tell me that you are learning programming from the reverse way of it. Complex programs first and lastly comes the basic knowledge of programming. Which one? Am confused and wonder what was your approach in learning programming. Please explain. Waiting eagerly for your reply. Take care.
Nov 20 '06 #9

Expert 5K+
P: 8,434
Some people do prefer to get started by taking existing code and playing with it. Perhaps that's the case here.

Or perhaps the OP is a bit embarrassed to post their code for the world to see. This is often the case, especially in those relatively new to a language. I feel a bit that way myself at times, and I've been dabbling in VB for ten years or whatever
Nov 20 '06 #10

P: 6
Sorry, i was on vacation.
I cant remember all the questions asked but
I'm simply using codes i know to create the game i am making, a basic rpg, where you click buttons for the majority the game.

for question 1,
I would like to save the progress of the user so that the next time they access the program they may start where they left off.

I know a good amount of code, even though there is so much more code for me to learn. Most of the time my problems could be solved with code i can use.

almost like i need a database of all the different codes and there uses,
Nov 27 '06 #11

P: 1
Hi, New guy here... first post... anyway.
Starting out building an RPG is a very good step. It will expose you to TONES of VB concepts and applications. The things you are going to need are:
1: to logically lay out the game mechanics. This in needed so you will be able to develop the required programming structure.
2: a very good place to search for code, make sure you have the latest MSDN installed for the language you are programming in.
3: Build the structure first. Worry about story line and graphics later. Use sample graphics and text when necessary.

OK now for a few points to study on.
1: Yes you will need a database. With a database you will be able to set what each button does and which picture/graphic is shown. Keep in mind that your buttons can have there position, label/caption, size, etc set from variables stored with in your database. The basic code of your button will simply be a SQL quary to your database using variables set by the player during the game.
I.E. you have a graphic background, 2 buttons, 2 labels and a text box.
first button.caption is "Sell" 2nd is "Buy" the label.caption is " +Town XYZ + market has +41+ +apples+ which sell for +$0.40+ each. You currently have +2+ in your bag the market is willing to buy for +$0.10+ each"
The +sign shows you each variable that would have to come from your database for that statement. The text box let's you tell the game how many, and the button tells the game buy or sell and based on the qty on hand in the market the game resets the price on the apples. The buttons can then send you to the next screen or you may wish to have another button which states next screen. This button code would simply push to the database the "Name" of the screen you are on and ask for the contents of the next screen. The next screen information would contain something along the line of "Screen Name" "Background graphic" "Number of buttons" then what each button caption is, and on we go. Think / search on relational databases, MS Access should do just fine or you can use SQLServer Express (free from MS) or many other db servers out there.

2: Think / search on Artificial Intelligence programming, Big scarry name but simple enough in small doses which is exactly what you seem to need. See. Eliza or http://ai-depot.com/Intro.html for a decent introduction.

3: Think / search on Control arrays, Take a command button and copy it on the form then paste it and you will be ask if you want to create and array or not. Answer yes and you will now have a button named Command1(0) and a button named Command(1) this can be used to create and destroy command buttons, labels and other controls on the form. This is where it gets a lot more tricky so you will need to do a lot more studying and learning.

Hey that is what you are after isn't it?

Hope that helps a little, and another thing, when you are posting to a forum like this, be sure to include as much info about what you are actually doing as you can.
Sometimes you may run up against a wall because you went down the wrong hall? ;)

~Skulldragger
Nov 27 '06 #12

Post your reply

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