|
-
February 7th, 2005, 07:29 PM
#1
Changing Views?
Ok so im new to Windows Programming so if i word this wrong or this is really a simple question I apologize. Everywhere I turn people get confused or I cant find an answer.
Ok so right now I have my application like so
File Options1 Options2
---------------------------------------------------
display stuff
---------------------------------------------------
Now basically its a form with a menu and the main page. Now when they click in options 2 and select "Add user" I want the display information to be replaced by the Add user view. I hope this makes sense. Now I was going to just make another form, but then that means replicating the menu bar and thats a waste because id have to retype twice.
So im looking for a way to switch the screens as a menu option is picked, do I do this via a new form or what?
Thanks
-
February 8th, 2005, 12:13 AM
#2
Re: Changing Views?
It's usual to do this sort of thing in a seperate dialog form.
I.e. a form which you 'ShowDialog' on.
It is possible to switch views as your suggesting - I'm not sure whether it's necessary to go to that level of complexity though.
Darwen.
-
February 8th, 2005, 02:00 AM
#3
Re: Changing Views?
Darwen can you explain or show an example or something of the easy way then. I dont really understand seperate dialog forms? If the way im asking is too complex can you show me how I should do it?
Thanks.
-
February 8th, 2005, 02:52 AM
#4
Re: Changing Views?
Hi Ctwizzy,
here's is another link to add to your collection: UI Patterns and Techniques
Useful? Then click on (Rate This Post) at the top of this post.
-
February 8th, 2005, 09:21 AM
#5
Re: Changing Views?
Yes this website is in my list allready thanks lol.
Still looking for the solution to present different data from a different selection...
-
February 8th, 2005, 09:40 AM
#6
Re: Changing Views?
Whether this is the way to go is another matter, it all depends on your other options.
But, in direct answer to your request "I want the display information to be replaced by the Add user view"...
Rather than a Form put the controls for display info and "add user view" into UserControls.
You can then use a tabbed control in the main Form eg. Card Stack and place each user control on a separate tab.
Or you can switch controls manually by adding all the user controls to your Form and setting the Visible property appropriately.
Useful? Then click on (Rate This Post) at the top of this post.
-
February 8th, 2005, 09:56 AM
#7
Re: Changing Views?
Rather than a Form put the controls for display info and "add user view" into UserControls.
Yes, I'm using that kind of "UserControls" and I have already 2 year expirience with it.
From my expirience I can tell: it works perfect!
Best regards,
Krzemo.
-
February 8th, 2005, 11:26 AM
#8
Re: Changing Views?
I am a C#, make that Windows Programming novice. I have heard of user controls, tho no idea how/when to use or how to make them change the view. Could you show me and example, or walk me through the steps. Or if there is a tutorial somewhere?
Thanks
-
February 8th, 2005, 02:01 PM
#9
Re: Changing Views?
Im using this example to learn user controls
http://www.codeguru.com/forum/newrep...te=1&p=1091866
problem is, it jumps steps. So I have created my user control is a userControlLibrary, then it says add the dll.
Problem is it shows no way of creating this dll?
So I have a user control with 2 labels and a timer on it which displays the date and time. I want to include this user Control on my main application, but I dont know how now, so if someone could help please.
Also someone above said I can use user Controls to control which view is being shown to users. How would I go loading and unloading the user controls as a button is pressed??
Thanks
-
February 8th, 2005, 06:02 PM
#10
Re: Changing Views?
Ok I built the control, and then referenced the dll in the bin dir.
So now I have my control working.
Can anyone tell me how to hide and show controls?
-
February 9th, 2005, 01:10 AM
#11
-
February 9th, 2005, 01:27 AM
#12
Re: Changing Views?
And this is the way I should be switching what information the user sees based on their selections?
-
February 9th, 2005, 02:55 AM
#13
Re: Changing Views?
Which tools are you using to build your app? Notepad or VisualStudio?
Building apps without a proper IDE will be painful. Here's a free one: SharpDevelop.
And this is the way I should be switching what information the user sees based on their selections?
It's one way. If you want consistency, simply look at how other existing apps work.
Useful? Then click on (Rate This Post) at the top of this post.
-
February 9th, 2005, 03:21 AM
#14
Re: Changing Views?
And this is the way I should be switching what information the user sees based on their selections?
Yes. As Norfy already mention it:
You can then use a tabbed control in the main Form eg. Card Stack and place each user control on a separate tab.
Or you can switch controls manually by adding all the user controls to your Form and setting the Visible property appropriately.
So 1 of solution is to change Visible property of your controls placed in your form inside captured event (for ex: If user checked Checkbox than one of the controls will appear, if unchecked it will get hidden)
2nd solution is to place controls on tabcontrol and change tabcontrol index.
Hope it Helps.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|