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

If not CAB, then what?

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a

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.