471,594 Members | 1,888 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,594 software developers and data experts.

If not CAB, then what?

I want to design/develop a Win app with an Outlook-like feel. That is, lots
of different modules. If I don't go with Composite UI Application Block
(CAB) design, how else could I do it? In other words, what could allow for
"master/parent" functions without having to duplicate them to every single
form?

I've used user controls (instead of forms) for various "modules" and insert
them onto a master form, but is this my only other alternative?

Thanks,
Ron
Jan 29 '07 #1
1 1163

You have to look into the MVC (Model View Controller) pattern.

Basically.

Somewhere, there exists a "model". A model is usually some data.

You build views .... which will work with the model.

The controller acts as in in-between.

-- that's a quick, wayyyyy to little explanation. As in, don't expect to
learn MVC from reading 6 lines of a newsgroup post.

However, here is a winforms tip:
Then.. (in a winforms app), you can do some some bindings.
Binding titleIdBinding = txtTitleId.DataBindings.Add("Text", this.m_model,
"TitleId");
//this is another "hint" .. after you get past the initial learning
curve//titleIdBinding.Format += /* might be wrong, please check */ new
EventHandler(BindingNullCheck);

this.txtTitle.DataBindings.Add(new Binding("Text", this.m_model, "Title"));
this.txtType.DataBindings.Add(new Binding("Text", this.m_model,
"TitleType"));
this.dtpPubDate.DataBindings.Add(new Binding("Value", this.m_model,
"PublishedDate"));
this.txtPubDate.DataBindings.Add(new Binding("Text", this.m_model,
"PublishedDate"));

// a child sub object
this.txtPubId.DataBindings.Add(new Binding("Text", this.m_model,
"CurrentPublisher.PublisherId"));
this.txtPublisher.DataBindings.Add(new Binding("Text", this.m_model,
"CurrentPublisher.PublisherName"));

here, my "model" is a class
(abbreviated represenation, all the items are properties)
class Title
public string TitleId
public string Title
public string TitleType
public DateTime PublishedDate
public Publisher CurrentPublisher // child object

class Publisher
string PublisherId
string PublisherName
................
..Net 2.0 has some improvement handling NULL values. Which is important when
you're adding a new item.. and don't have a populated model .
'Improved in .NET 2.0 //
http://msdn2.microsoft.com/library/y...us,vs.80).aspx
'titleIdBinding.NullValue = "Type a TitleID Here";
Good luck....

"Ronald S. Cook" <rc***@westinis.comwrote in message
news:%2***************@TK2MSFTNGP06.phx.gbl...
I want to design/develop a Win app with an Outlook-like feel. That is,
lots
of different modules. If I don't go with Composite UI Application Block
(CAB) design, how else could I do it? In other words, what could allow
for
"master/parent" functions without having to duplicate them to every single
form?

I've used user controls (instead of forms) for various "modules" and
insert
them onto a master form, but is this my only other alternative?

Thanks,
Ron


Jan 29 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

220 posts views Thread by Brandon J. Van Every | last post: by
699 posts views Thread by mike420 | last post: by
92 posts views Thread by Reed L. O'Brien | last post: by
137 posts views Thread by Philippe C. Martin | last post: by
12 posts views Thread by Dario | last post: by
47 posts views Thread by Neal | last post: by
121 posts views Thread by typingcat | last post: by
8 posts views Thread by Midnight Java Junkie | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by Anwar ali | last post: by

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.