|
Well, I'd do winforms, because
1) the drag 'n drop editor does not suck
2) existing code will fit it better because everyone is used to it
3) text rendering is not blurry and headache-inducing
4) you're not writing an advert so why does it have to look flashy?
|
|
|
|
|
harold aptroot wrote: 1) the drag 'n drop editor does not suck
Do you mean the wysiwyg editor for creating the actual forms?
|
|
|
|
|
He does - the editor isn't brilliant - that's why a lot of people developing in WPF also use Blend. It doesn't bother me though, as I prefer to use the code editor when creating WPF forms pretty. The blurry text issue is a problem in the current version of WPF, but the next version uses a significantly enhanced version of the font renderer, and it's a lot clearer.
I forgot to mention - WPF uses DirectX natively, whereas WinForms uses GDI+ natively. This means that you can do things like 3D in applications that would be hard (if not damn near impossible) to do in WinForms.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Pete O'Hanlon wrote: I forgot to mention - WPF uses DirectX natively, whereas WinForms uses GDI+ natively. This means that you can do things like 3D in applications that would be hard (if not damn near impossible) to do in WinForms.
That's another reason to use WPF. Although I'm not looking at a 3D app right now - it is something I want to look at in the future.
|
|
|
|
|
You could always host a DirectX viewport in your winforms app, you just need an empty panel for it.
That's the only good place for 3D that I can think of - if you just use it randomly for buttons or something like that it would just look flashy and "like an ad"
|
|
|
|
|
Do you have to use XAML for GUI's - or will a WPF form use defaults if no GUI is coded?
Think I've got a good few hours of tutorial hunting ahead of me....
|
|
|
|
|
You can write your GUIs in straightforward C# if you want - there's no rule that says it has to be written in XAML. Reading your question, I suspect what you're asking is do you have to restyle the controls or does WPF apply defaults if you haven't. If this is the case, WPF provides a default look and feel that you can change as much or as little as you like.
Marc Firth wrote: Think I've got a good few hours of tutorial hunting ahead of me....
OK - you need to buy WPF Unleashed [^]by Adam Nathan and Pro WPF[^] by Matt MacDonald.
On top of that, you can read up on this stuff in articles and blogs by my fellow WPF Disciples like Sacha Barber, Karl Shifflett, Josh Smith and Marlon Grech.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Pete O'Hanlon wrote: OK - you need to buy WPF Unleashed [^]by Adam Nathan and Pro WPF[^] by Matt MacDonald.
Sold.
Pete O'Hanlon wrote: Karl Shifflett,
Not related to Chris Shifflett [^] is he? (Chris is probably the best PHP security expert I know of)
I had a quick look at your blog, will definately revisit.
Thanks again
|
|
|
|
|
Pete O'Hanlon wrote: OK - you need to buy WPF Unleashed [^]by Adam Nathan and Pro WPF[^] by Matt MacDonald.
The books have arrived. Excellent Recommendations. Makes it all look easy! Especially Pro WCF. Thanks!
|
|
|
|
|
Hello all you C# and Excel programming people,
some days ago I discovered something that I have to tell...
I wrote a programm writing/reading to and from an MSSQL-db to and from Excel-sheets.
In one of my Excel-sheets I have to read the column "A" in order to get the right row to insert some values.
inside a ...
for(int row=0;...){ // I do like...
Excel.Range range = (Excel.Range)mySheet.Cells[row, "A"];
string val = range.Text.ToString();
...
}
The problem is: when one of the rows is hidden I do not get the row and for that reason I don't get a value.
When the whole column "A" is just not as wide as it has to be you can only see "####" and this is exactly what I get, what my string val looks like.
So the data in the Excel sheet is some number, but what I get is only what I see.
IF someone knows how to get rid of such a problem, I'd like to know.
Else I just wanted to mention.
Greets
Harry
no plan,
no signature
|
|
|
|
|
Harry666 wrote: string val = range.Text.ToString();
have you tried without the ToString() method?
When it is called Text, I suspect it already is a string...
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Well, calling it Text doesn't make its type to string. It's just an object.
So this would simply not compile:
string val = range.Text;
Instead of using .ToString()
perhaps I could cast like this...
string val = (string)range.Text;
But there is also .Value (clearly spoken I've got no .Value but .Value2)
...let's try
no plan,
no signature
|
|
|
|
|
You must use .Value , not .Text , in order to obtain the content of the cell.
2+2=5 for very large amounts of 2
(always loved that one hehe!)
|
|
|
|
|
Thanks,
I already thought and was about to try this, but I almost forgot it.
Some points to mention:
My Excel.Range doesn't have a .Value but there is .Value2
... they probably do almost the same.
If there is no value in the cell (the range), Value2 equals null. So I have to test it...
if (range.Value2 == null)
val = "";
else
val = range.Value2.ToString();
Using range.Text.ToString()
I do not have to test against null, I just get an empty string.
Greets
Harry
no plan,
no signature
|
|
|
|
|
Yep all correct. If I remember right, the fact it's Value2 instead of Value merely depends on how the interop assembly is built. But it's been a long time since I used that, so you may want to check, just to be sure.
Yep I know that Text doesn't require a null check, but it represents the exact text shown in the cell.
This means it will be, for example, "#####" for cells whose width is not enough to show the (numerical) content, etc.!
So, I doubt it will be of any use to you.
2+2=5 for very large amounts of 2
(always loved that one hehe!)
|
|
|
|
|
So be it.
Value2 gives me what I need. That's bought - I take it. (German expression translated literally )
I simply check it and set it to "" if it equals null. (I don't mind these 2 lines of code).
I know nothing about the history of Value and Value2 .
Perhaps it is because I use Microsoft.Interop.Excel Version12.0.0.0 or Microsoft.Office.Tools.Excel.v9.0
Well, I simply can forget Text and use Value2 . So be it.
Thanks,
Harry
no plan,
no signature
|
|
|
|
|
Wunderbar then!
Enjoy!
2+2=5 for very large amounts of 2
(always loved that one hehe!)
|
|
|
|
|
Hi,
I'm looking to build a component which has to listen current active form for any changes over any controls.
Let's say I've a form with 10 controls and those controls have to subscribe with my component to listen the activities.
Is there any pattern or components like this ?
Thanks
|
|
|
|
|
It sounds like you're thinking of the Observer pattern.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I created an offer-report application, C# and MS-Access.
Its multi user application. Not so big, so leave DB part and don't comment
What i want to achieve, is one record viewed by multiple Users.
A record created by a manager(higher marketing person), now he assigns some persons to look after it, and update it. presently he can assign 1 user, and when user log-in with his ID-pass, he can see offer assign to him(Not all).
Now, they want to assign multiple user for single offer.
if one is on leave, another can handle his task.
How to do this?
regards 
|
|
|
|
|
With a many-to-many relationship; the simplest way is to have a table that contains the IDs of the assignments and agents (or whatever):
Assignment
ID , Description ...
Agent
ID , Name ...
Offer
AssignmentID , AgentID ... (perhaps datetime of when it was assigned and by whom, etc.)
So then if Assignment 1 is offered to Agents 1 and 2, there will be two rows in Offers -- 1,1 and 1,2 .
|
|
|
|
|
I am not getting your idea !!
Doesn't this going to create redundancy in offer table, if for a single offer i create same rows with only change in AgentID?
At present this way i had design DB tables!!
Table - Offer(ID, PartyName, offerDate, etc....., AssignPerson,...)
Table - Users(Name , pass)
table offfer is main table holding all discription about OFFER.
Now at offer creating i simply insert Assign person name in Offer table,
and at login time checks login name and fetch only records
...from offer where AssignPerson = loginName
regards 
|
|
|
|
|
Hum Dum wrote: create redundancy in offer table
No, no two records should be the same there.
Hum Dum wrote: only change in AgentID?
Maybe, but perhaps also in any other fields you may have there, e.g. when assigned and by whom.
Hum Dum wrote: Table - Users(Name , pass)
Your users should have IDs, then you use the ID, not the name. And are you storing plain text passwords?
|
|
|
|
|
PIEBALDconsult wrote: No, no two records should be the same there.
But all fields are same also data, except AgentID ?
PIEBALDconsult wrote: And are you storing plain text passwords?
Quote Selected Text
yes. is this incorrect?
|
|
|
|
|
Hum Dum wrote: And are you storing plain text passwords?
Quote Selected Text
yes. is this incorrect?
Yes. Anybody who can gain access to the database can see a users password - remember that this could be somebody who's managed to hack into your system.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|