hey all...
its very hard to explan i hope you understand it and help coz i really need your help guys
the thing is i have to make the user choose the number of matrix with this number i have to create the same number of matrices again and do calculation on each one
like if user matrix 3x3 i have to redo this matrix with different value 3 times
my question is :
1- how can i re do the same number of textboxs over and over .
2- how i can calculate each matrix and get the value
i hope you understand
To create a TextBox dynamically, just new up a new instance of a TextBox, set the properties to decide where it should be shown, and add it to the Controls collection of the container where you want to place it.
As well as adding them to the Controls collection, you could also add the reference to your own collection, which could be, for example a list of lists. That way, when you need to do the calculation you'd just loop through that collection and get the values from each TextBox.
Related
GameObject[] buttonarray = new GameObject[100];
GameObject[] textarray = new GameObject[100];
Initially I was going to individually make 100 text game objects and 100 button game objects.
Then I realized that I can make an array of each. Now I'm stuck since I'm not sure how to add the buttons or text to the array.
I want to make the grid randomize an integer onto the text on the screen and have the user click it that many times until it becomes zero. Once all of them are clicked the user wins.
This is how I was able to make the grid.I made them into panels and each panel with 10 buttons.I'm new to Unity so please let me know if there is a another way I might do this in unity itself.
There is a GridLayout component that you can use:
It works using the UI/Canvas, so it might need a canvas, but you can make a world space canvas with no UI rendering objects and still use it
There is a component you can add to the parent object of the buttons, if none exists create one. The name of the component is escaping me at the moment however it you just search in the component field you should find it with "grid" or "layout".
What it will do is space the elements equally to your liking.
I am working with Visual Studio 2010 ReportViewer WinForms.
I have been unable to figure out how to fix the rectangle height in a report. I've tried using a table within the rectangle, also a table in a sub report that is placed in the rectangle of the main report with no success.
Basically, I am setting up an invoice-type report that must keep its' form and should not be allowed to grow so that elements are pushed onto a second page.
Both rectangle and tables will always grow vertically based on the content. There is no way to really stop this.
There are a couple of properties that might be able to help you get the correct page breaking in place:
KeepTogether indicates whether to keep all sections of the data region together on pane page.
When set on true and the region is to large to fit the page, this will add a page-break before the start of the region to try and fit as much as possible on a single page.
So if you wish for the region to start at the initial location but break afterwards, make sure this is to false.
PageBreak has the parameter BreakLocation which can be used to determine a fixed place to add a page-break. You can set it on Start, End, StartAndEnd or Between.
You could split your report in fixed pages and use these to add standard page-breaks in the desired (fixed) locations.
These properties alone might not be enough to get your desired result. Especially when working with tables it is hard to add a page-break after a fixed amount of rows.
It is hard to give you a detailed description of a possible approach with the amount of information you gave me, but here is some general advice.
You should split your data in the correct intervals before sending the datasource to the reporter. You can for example use grouping to place them in the correct intervals and add page-breaks based on the grouping.
Another solution is to add them in separate containers, this will require you to have enough spare data regions at your disposal. If there are too many you can always hide the empty ones based on an expression set for the Hidden property.
It won't be easy to set this up correctly so that it can dynamically grow. It takes a lot of puzzling from your end but pretty much any layout should be possible to achieve.
I wish I could give you a more specific solution to your problem and am willing to help you further if you give me an example to work with. But ultimately this is something you should be able to achieve on your own.
We are developing an application in C# and WPF, that requires the user to select one or more items in a 2D area using the mouse in order to edit their corresponding properties in text fields below it. I am new to C# and WPF and currently trying to figure out the best way to implement this.
The figure below shows a scetch of what I have in mind. Each circle represents an item of the same type whose properties/values can differ between instances. The user should be able to select a single or multiple items using either Mouse-Click, Mouse-Click+Ctrl, or Mouse-Drag (by selecting an area). Furthermore it would ideal if similarly columns and/or rows could selected by selecting one or more of their numbers/letters.
Furthermore the color of the items should change border-color to signal their selection-status (selected vs. unselected) and fill-color to signal their contained values and make groups of identical items easily identifiable.
The number of shown items (cirlces) needs to scale to at least 400. In the future perhaps 2000 or more, so performance could become an issue. By then the area would likely also have to be zoomable. However at the moment ease of implentation has highest priority.
I am currently reading up on WPF and it seems, that the unified grid along with templating to fill it might be an option. However, I am unsure if the performance will be sufficient(?).
I am hopeful, that someone has already implemented something similar and perhaps could recommend a direction for further investigation. Thanks in advance and best regards.
Been struggling with this through out the day. I have three series on a chart that look like this. NOTE: I am using the winforms control.
The values are being added based on calculations from input. I am using this code to add the values to each series.
this.chart1.Series["green"].Points.AddY(greenvalue);
this.chart1.Series["totalsaving"].Points.AddY(totalsavingvalue);
this.chart1.Series["blue"].Points.AddY(bluevalue);
The series properties I have set like this. Green and totalsaving are both set to StackedColumn, blue is set to Column for chart type.
I then have a button to start over which brings the user back to the input area and I am then using this code to clear the series values on the start over click.
chart1.Series["totalsaving"].Points.Clear();
chart1.Series["green"].Points.Clear();
chart1.Series["blue"].Points.Clear();
The same calculation click is being used as above to calculate and populate the series data. The problem is when I click the calculate button to calculate the values after I have cleared them, the total savings, and the green are missing. Just the blue is shown.
Am I doing something wrong with the way I am trying to clear the values so I can re calculate?
OK, from the edits, comments, our chat and the joim.me session enough data has accumulated to answer the question.
You have twisted the display by adding an extra data point to the blue series in the designer.
This point occupies slot 1 but remains invisible as its value = 0.
This pushes the next point in the series to slot 2
After clearing the points it is gone and the display doesn't work anymore.
The disappearing of the two columns probably was caused by hard coded widths.
You have several paths you can follow:
recreating the extra point with value = 0 before adding the real data (not recommended)
not adding the extra point in the first place but forcing each point into its slot by using Points.AddXY instead of Points.AddY with X being the slot.
not clearing the points but updating their values by using the SetValueY method. After all three data points have beend assigned their new values you need to call chart1.Invalidate() to make it show.
Fore easiest styling of all those properties, some of which are deeply burried inside of property strings(!), you may even decide to add and style&polish all three points in the designer and only update their y-values like this:
chart1.Series["green"].SetValueY(greenvalue);
chart1.Series["totalsaving"].SetValueY(totalsavingvalue);
chart1.Series["blue"].SetValueY(bluevalue);
chart1.Invalidate();
The choice is yours, but in any case I recommend setting the proper X values, be it in code or in the desginer..
I am trying to create a Report with two columns.
Records should add in as below...
1.Bob 6.Sarch
2.Sue 7.Barrie
3.Adam 8.James
4.Dave 9.Steve
5.Robin 10.Euan
11.Fred
12.Heidi
13.Liz
For the first column (1-5 in this example), a page break should wrap the data to the second column (6-10). After the second column is full (11-13) the the data should page wrap.
The data used to generate the report will have a fixed number of columns. The height and width required for the data will not change.
I am using with C#, WinForms, .net4. I have tried several various approaches with no success. Thus far I have only managed
1.Bob 2.Sue
3.Adam...
Please help or point me in the right direction :-)
Many Thanks
TL;DR ---> This isn't possible with SSRS, afaik.
If I understand correctly, you want to list the items in a data set, that when rendered with a hard page break renderer will render with these requirements:
items are added vertically as long as there's space on the page
a new column of items is started when the first column ran out of space, vertically
a page break is inserted when the second column filled up the vertical space, thus starting a new, first column on a new page
Now, there's only these controls in SSRS:
Textbox
Table, Matrix
Chart
Gauge
List
Image
Subreport
Line, Rectangle
Out of these only the Tablix (Table/Matrix) and List are remotely capable of such a thing, but they can't satisfy your requirements. I'm afraid the answer to your question is that this can't be (easily) done.
The hard way that this may still be possible is perhaps by creating a custom report item and/or by creating a custom rendering extension. But that may be overkill for just wanting to create a nice little list.