Hey. Does anybody know how to change Form designe on button click in the same Form, but not by opening new one.
Sorry for my English.
Do you mean as in move objects around on button click?
I'm crating Login system right now. And i whant to make all user panel in 1 Form. So I need to make somehow that on login button click the all designe of the form change to like: Welcom "username", and then display all the user information in the same form.
Edited 3 Years Ago by Pauliuz
Well I've personally done that before by laying out all the components of both parts and then controlling what is visible at load and then after button press to show/hide bits. However there may be a tidier option.
Mikey's way will work (I've done it before myself) but like he said it can get messy. If you're doing it that way make sure you start the name of all your objects with the type of layout you want (e.g. adminFirstNameTextBox for admin view or say userFirstNameTextBox for a generic user).
Another way is to make use of the Component object but having one form but multiple Components that just sit on top of the form. This way only the relevant component needs to be displayed dependent on the type of user, rather than having to keep making objects visible and invisible.
As well as being a bit tidier by seperating the controles for the different useres, it would add a bit of structure to your program and make editing the controles for the different types of users a lot easier (Users will more than likely want to add or remove object like textBoxes... trust me it comes from experience).
Edited 3 Years Ago by ChrisHunter
I've also done something with tab controls before and hooking into the draw at run time to hide the actual tabs showing, then programatically hopping between the two. Would need to google to find it again though.
I've also done something with tab controls before and hooking into the draw at run time to hide the actual tabs showing, then programatically hopping between the two
This works well if you want to keep all the controls and their handlers under one form.
The method I use is to set the DrawMode to OwnerDrawn fixed, Appearance to "Buttons" and the ItemSize to (5,5).
This allows you to click on the the buttons to change Tabs while in the designer and does not take away much design space.
The wrinkle that I throw in is to place a docked panel as the first control on each tab. Then all other controls are parented to that panel.
The tabcontrol is parented in a panel on the form during design. I set tabcontrol's Parent property to null on loading the form. This leaves it fully functional just hidden and out of the way.
I then play a Parent swap game with each TabPage's first control (the panel mentioned above) by setting it's Parent property to the panel that originally parented the tabcontrol. I use the SelectedTab property to keep track of whick panel is currently parented to the form.
Help! I want to create a java program that finds the highest even integer among the values entered by the user. Stop asking values when a value less than 1 have been entered. If no even integer is entered, display "No Even Integer"
Here is the sample output that I ...
Hello All ...
Iam Getting An Error With try to excecute the stored procedure .
I have Have Sql database , the stored procedure like so :
USE [MPRS] GO /****** Object: StoredProcedure [dbo].[Search_Licenses_By_Number] Script Date: 26-Nov-16 8:06:52 AM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE ...
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...