|
KissGnv wrote: After your suggestion, I think tablelayoutpanel is not a good solution Please, note that I did not directly advise you to avoid using a TableLayoutPanel; I simply told you about my experience a few years ago with it.
I strongly advise you to check out Jing Lu's open-source ReoGrid Control which has an article on CodeProject here: [^], and a web-site here: [^]. ReoGrid does everything but walk your dog, and is very, very fast. Note that the license model for ReoGrid may have changed, on the article on CP it's LPGL; I have written Jing asking him to clarify the current license model.
Why not create a prototype to test, on the type of hardware you'll run your app on, that loads a TableLayoutPanel with as many Controls with synthesized sample data as you think you might need a maximum of, and then observe the speed of response.
Here's some code I used a few years ago: [^]. I suggest you increase the integer Constants that control the number of Rows, and Column, and observe the performance as you scroll.
To use the code in the linked to archive: 'unRar it, and copy-paste the code in Form1.cs, and LabelEx.cs into:
0. create a new WinForms project, set the Main Form, 'Form1 'DoubleBuffered property to 'true. Size the Main Form to taste. Replace its code with the code in the archive for 'Form1.cs.
1. add a Component named 'LabelEx to your Project: replace its code in the file from the archive 'LabelEx.cs.
2. On the main Form: put a TableLayoutPanel named 'testTbl: size it and set its various properties appropriately. Put a Button on the Form named 'btnCreateLayoutPanel, and set its 'Click EventHandler to use the code in 'Form1.cs.
«OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things. » Alan Kay's clarification on what he meant by the term "Object" in "Object-Oriented Programming."
modified 3-Dec-14 19:10pm.
|
|
|
|
|
Grids are generally a Very Bad Idea as a user interface. They can be OK in some limited instances with small amounts of data that aren't being changed often -- and with knowledgable users.
One application I tried to use a Grid for I found it completely unmanageable -- so I used a TreeView instead and suddenly everything was suddenly simple.
In either case, I prefer having the primary form display only the highest level data for each entry, then allow the user to select an entry and open a separate editing form with the details of that one item. Don't try to show everything in one place, and don't try to allow editing of everything with one giant Grid.
If you had to use the system eight hours a day with calls and guests coming in constantly, which would you prefer?
How about go to some local hotels and see what they use, what it looks like, what the users like and dislike?
|
|
|
|
|
There are 3 examples of programs, that are used in hotels.
Example 1 (A small local hotel that I visited is using this program.)
Example 2
Example 3
This model is good, beecause you see all rooms and all reservations at the same time on the screen.
|
|
|
|
|
PIEBALDconsult wrote: Grids are generally a Very Bad Idea as a user interface. They can be OK in some limited instances with small amounts of data that aren't being changed often -- and with knowledgable users. I know you are a very intelligent senior developer with strong theoretical interests, and deep expertise with data and databases, but I can't understand why you make this very broad assertion, given the almost universal prevalence of grids of one form of another (I include things like Spreadsheets, Gantt Tools, along with Data-Gridviews in the category of "grids") in every type of industry where scheduling and reservations must be modeled/implemented.
If you make that assertion, I'd appreciate ... and I'm sure other people would too ... a little more detail other than the fact you had a bad experience with using a grid. Surely, in the vast variety of grid-like software components, there must be some implementations you think are well-done ?
By the way, I share (what I believe is) your view that the MS DataGridView sucks; and, I happen to be a real enthusiast for using a TreeView (or multiple TreeViews) as a preferred UI element(s). I use a third-party commercial TreeView that just "walks the dog" ... having "switched" after years of frustration trying to bend the MS TreeView to my will.
I favor a "one data: multiple appropriate views" model; in the case of a Hotel System, I'd like the employee (who may have little formal knowledge of computer software, but adequate practical skill) to be able to quickly switch views depending on the task at hand: from checking on room availability by date ... to entering a booking ... to calculating a net cost ... to creating a summary report of day's activities, etc.
"How about go to some local hotels and see what they use, what it looks like, what the users like and dislike?" Now that's what I call "good advice:" learn from the end-user.
And, examining, closely, the most popular hotel-management systems available today, is the second piece of research I'd recommend [^].
«OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things. » Alan Kay's clarification on what he meant by the term "Object" in "Object-Oriented Programming."
|
|
|
|
|
|
That is called a gantt chart. I'd just find a freeware / open source gantt chart control online. These are tough to make.
|
|
|
|
|
Hello. I want to create a new node which has child node. This is not just an element. I am doing it liek this but get System.ArgumentException
XmlDocument doc = new XmlDocument();
string sNodeString = "<School>" +
"<Name></Name>" +
"<Address></Address>" +
"<Phone></Phone>" +
"<Courses>" +
"<Course></Course>" +
"<Course></Course>" +
"<Course></Course>" +
"</Courses>" +
"</School>";
XmlNode node = doc.CreateNode(sNode, "NewNode", "");
return node;
How could I do something like this? Thanks for anything.
This world is going to explode due to international politics, SOON.
|
|
|
|
|
What type is sNode , and do your parameters match one of these[^]?
|
|
|
|
|
Hi,
I have my registry key HKEY_LOCAL_MACHINE\Software\Jassim
Under Jassim key, I have list of keys, e.g. system1, system2, options, etc
System1 and System2 wil have SystemGUID value where options key will not have.
I want to loop through all keys under Jassim key and found every key which has a SystemGUID key in it to list it in a Combobox?
How can I do this please?
Thanks,
Jassim
Technology News @ www.JassimRahma.com
|
|
|
|
|
With one minute of searching within CodeProject (or using Google) you can find C# code for enumerating the contents of a Registry Key. So, why aren't you doing that ?
If you created the Key and sub-Keys using C#, isn't it pretty obvious how to use the same Classes to read them, and parse them as required ?
«OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things. » Alan Kay's clarification on what he meant by the term "Object" in "Object-Oriented Programming."
|
|
|
|
|
Please, don't use the registry - particularly not for new projects!
Access to the registry is now restricted, and is likely to become more restricted in future - because it was abused so much in the early days.
There are much better ways and places to store data now: have a look at this and it might help.
Where should I store my data?[^]
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Save your breath; he's been told this innumerable times, and even had a demonstration of why it won't work.
|
|
|
|
|
You really should start making use of the documentation[^] for yourself, and Google and CodeProject articles.
|
|
|
|
|
i would need to know the most effective way get the name of the application from the Registry/LocalMachine/Software/Classes/.docx/shell/Open/Command . for example from this
"C:\Program Files (x86)\Microsoft Office\Office15\POWERPNT.EXE" "%1" /ou "%u"
i would need only the 'POWERPNT.EXE'. substring and replace is not effective as the value inside appears differently. for example
"C:\Program Files (x86)\Microsoft Office\Office15\EXCEL.EXE" /dde "C:\Program Files (x86)\Skype\Phone\Skype.exe" "/uri:%l"
|
|
|
|
|
|
I've programatically built up a Path object. This part works perfect.
Now I want to add a vertical "threshold". So say my path goes from Y=0 to Y=100. The "threshold" may be at Y=50 or whatever. I want the path Y <= 50 to be blue and the path Y > 50 to be green or whatever.
So, right now, I'm using a LinearGradientBrush (oriented vertical and calculate the transition point and do something like
0 color1
0.5 color1
0.5 color2
1 color2
By having the two stops at 0.5, you get the hard color transition which is what I'm looking for.
Now the problem ...
Depending on where the threshold line is, the LinearGradientBrush gets round off errors and sometimes the color break is 1 line too high, sometimes 1 line too low.
What I mean is, my control is 27 pixels high, so the threshold line is at y=14. So theoretically, color1 should always be above the line and color2 below, but sometimes it shifts up due to the round off errors.
Any other way to do this that'll yield better results?
|
|
|
|
|
That's an interesting problem which takes me back to when I was at Adobe implementing the PostScript code for printing the very complex gradients that Illustrator 5.0 enabled.
It might be helpful if you could post a link to a graphic, or two. Knowing what type of elements you used to build the Path would also be useful: arc ? bezier ?
I wonder if your use-cases are approaching the limits of what can be resolved in terms of color-shift on the screen ?
One idea/guess: what if you built a Graphics Region of only "line-to's" ("flattening" arcs or beziers into line segments), and then rendered the Path by enumerating the Region ? Well, does sound far-fetched and what about impact on performance, but no harm done trying to think-outside-the-box, here.
«OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things. » Alan Kay's clarification on what he meant by the term "Object" in "Object-Oriented Programming."
|
|
|
|
|
Here is perhaps a simple example. I might be getting thrown off by the gradient behavior. If you print screen and zoom in with Paint (or some program that doesn't muck with the pixels as you zoom), you'll see the gradient isn't doing a clean break. Even though if you punch the numbers into Calc, they looks correct to me.
<Window x:Class="WpfApplication4.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525"
UseLayoutRounding="True" SnapsToDevicePixels="True">
<Grid>
<Grid Background="LightGray" Height="27" Width="103">
<Line X1="0" X2="103" Y1="21" Y2="21" Stroke="Red" RenderOptions.EdgeMode="Aliased" />
<Rectangle Height="27" Width="50">
<Rectangle.Fill>
<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
<GradientStop Offset="0.0" Color="Black" />
<GradientStop Offset="0.77777777777777779" Color="Black" />
<GradientStop Offset="0.77777777777777779" Color="Orange" />
<GradientStop Offset="1" Color="Orange" />
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
</Grid>
</Grid>
</Window>
|
|
|
|
|
Sorry, SledgeHammer, I think my post was way off-target in terms of really understanding what you are doing.
I certainly do have a deep experience in "gradient fills," and some form of awkward out-of-kilter color transitions (banding) resulting from "impedance mismatch" between bitmap resolution and rendering-device resolution and type is certainly a typical problem. I spent months while at Adobe (in the late Neolithic era) doing systematic research on creating optimized PostScript code that took into account device characteristics (from 300 dpi laser-printers, to 2400 dpi photo-typesetters, to inkjets, etc.) in deciding how to render gradients in color separations, as well as mono-color.
So, please forget my whacko idea about using 'Regions: I focused on "Path" in terms of how you might be "stroking it" rather than "filling it."
«OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things. » Alan Kay's clarification on what he meant by the term "Object" in "Object-Oriented Programming."
modified 3-Dec-14 0:51am.
|
|
|
|
|
It is a stroked line.
Think of a stock chart for example. Typically, its a line graph where the above last close is stroked green and the below last close is stroked red. The last close line is typically a 1 pixel horizontal line. So, its very important asthetically for red pixels not to "bleed" over into the part of the chart thats above the last close line and for green pixels not to "bleed" over into the part of the chart thats below the last close line.
So... I'm trying to implement something similiar.
Paths don't natively support that kind of stroking, so the WPF "trick" is to use a vertical LinearGradientBrush and do a hard color change over at the correct Y position to match up with the horizontal line.
Unfortunately, the LinearGradientBrush works on a 0.0 to 1.0 coordinate system where as a line placed on a grid is going to work on a 0.0 to 26.0 coordinate system (control is 27 pixels high).
I kind of gave up on splitting the path as that has the same issue as the LinearGradientBrush and introduces the whole problem of having to write my own split algorithm.
So it seems like the real problem is I'm not "rounding / fudging" the LinearGradientBrush in the same way that a 1 pixel horizontal line is going to get rounded / fudged on to the grid.
Think about it, if I have a 27 pixel high control, there is certainly a center horizontal line at y=14 and you are left with 13 pixels on either side. HOWEVER, mathamatically speaking, that point is at 13.5.
Since my control is 27 pixels high, I think the y position needs to be rounded to .5's to match up the gradient break with the line break.
Haven't quite matched the WPF fudging though
|
|
|
|
|
Okay, well I understood your question more than I thought I did
Given the presence of a "last close" line in some color other than red or green, and assuming there's always at least one pixel of "open space" both below and above the integer value of the height of the close line:
I'd simply draw the red line up to close line height minus one, and draw the green line beginning vertically at close line height plus one. So I'd be validating the last vertical position of the red line, and the first vertical position of the green line and "doing the right thing."
I'd also draw the close line last ... as an overlay ... to hide any mistakes that were made.
Am I on your frequency yet ?
«OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things. » Alan Kay's clarification on what he meant by the term "Object" in "Object-Oriented Programming."
|
|
|
|
|
Jesus... why is everything like pulling teeth?
So I tried going down a different path (no pun intended) and decided to split the path along the threshold line. That way I wouldn't have to deal with the gradient rounding errors.
So, I find some code to split the path (combining the geometry with an exclusion rectangle) and I tweak it to split it how I want it. Then I notice that the half that has the last point auto closes to the first point!!
Are you serious? What good is that?
I find a post about somebody else complaining about it **5 YEARS** ago on the MSDN forums and the MSDN guys respond saying they "know about it, but oh well, that's how it works..."
|
|
|
|
|
Hi,
I am sending email using C#. I would like to know, while sending, ow can I get a delivery receipt or flag in order to update my database with the status?
Thaks,
Jassim
Technology News @ www.JassimRahma.com
|
|
|
|
|
Did you consider searching CodeProject: [^].
«OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things. » Alan Kay's clarification on what he meant by the term "Object" in "Object-Oriented Programming."
|
|
|
|
|
but this will send a delivery receipt email..
How can I receive it as a flag when sending the email so that I can update my database table status accordingly?
Technology News @ www.JassimRahma.com
|
|
|
|
|