|
You have to do it manually. Whenever the user scrolls, dispose the controls going out of view and create new controls for the items coming into view.
Or, the alternative solution (IMHO better):
Use the Paint event of the control and draw using the e.Graphics object.
Something like this:
protected override void OnPaint(PaintEventArgs e) {
base.OnPaint(e);
foreach (Cell c in cells) {
c.Paint(e.Graphics, new Rectangle(...));
}
}
class Cell {
public void Paint(Graphics g, Rectangle r) {
}
}
You'll have to write the code to manage the cells and their drawing positions.
|
|
|
|
|
ok thanks, i'll test it tomorrow and will tell you if it works thanks
|
|
|
|
|
hello, and how can i make this to show only the controls, they're needed? With the method "Hide" and "Show"? To find out which isn't needed is no problem, but what must i tell my UserControls to say them, that they didn needed or needed now?
|
|
|
|
|
well... now i made following...
a table control (like i had before) and a panel... i load now all cells (usercontrols) and so on in a list...
at first i start the method(cellArrange()) which tolds the cells their right position... then and if i scroll or resize my control, i search for all cells in the list which are in the visible region... now when it is visible, it says "panel1.Controls.Add(cell)" and if it shouldnt visible "panel1.Controls.Remove(cell)" but i get the same errors like before (out of memory) what to do?
|
|
|
|
|
Can I ask *why* a datagrid isn't right for your project? There are a lot of 3rd party grid controls out there that can do custom editors if that's what you need.
|
|
|
|
|
softwarejaeger wrote: i think at my project in that form i have round about 3000 controls.
Can you remember what they all do???
|
|
|
|
|
softwarejaeger wrote: what do you mean with "obscene" number of controls... i think at my project in that form i have round about 3000 controls.
That's pretty obscene. I tried to put 3000 controls on a form, and it doesn't work properly. It never seems to finish drawing the controls so the program is overwhelmed by events, but there is no memory problems or graphics problems at all.
softwarejaeger wrote: what to do?
Debug.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Check your computer memory aswell, is your computer running low memory due to lare number of processes running.
And secondly, my friends suggestion might work out that your application might stuck out due to replication of the object in a loop.
|
|
|
|
|
Hi
I have 2 queries,1 query for datagrid anad the other for textbox in one form.
How can I use dataset,dataAdapter,dataview…?
Do I need one dataset or two?
Please help me
Thank you very much
|
|
|
|
|
Please post what exactly your problem is. What you want to do.
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
|
you need only one dataset.Add it with your table name in dataset, then while assiging it to datagrid and TextBox give the appropriate Datamember name .
like
datagrid.datamember = Tablename for textbox
datagrid.datamember = Tablename for datagrid.
datagrid.dataSource = datasetName.
|
|
|
|
|
but i have one table and 2 query
now do i need one dateset?
|
|
|
|
|
Hi all,
I started my first xml writeing /reading project
I want to save all the text in the textboxes of the form to an xml file ( save file) and then load it back later.
I have the writing XML down ( i think please let me know if you have ideas)
but here is an example of my output
?xml version="1.0" encoding="UTF-8"?
Root
FileInfo
Region Region="Region1" /
TourName TourName="mens2006" /
Username Username="rbarbrow" /
timestamp TimeStamp="9/2/2008 1:25:26 AM" /
/FileInfo
MatchInfo
Match TB_32_C="No Chatter" /
Match TB_32_U="1-North Carolina (32-2)" /
Match TB_32_L="16- Play-In-Winner" /
Match TB_32_S="Raliegh, N.C., Friday 7:10" /
Match TB_33_C="No Chatter" />
Match TB_33_U="8-Indiana (25-7)" /
Match TB_33_L="9-Arkansas (22-11)" /
Match TB_33_S="Ralegh, N.C., Friday, 9:30" /
/MatchInfo>
/Root
The idea is that i have textboxes TB_##_(U,S,L,C) and that i can read what textbox and what text and then read the text back in
the problem is that i can read the text with the .getattribute(i) method ("no chatter" or "1-North Carolina (32-2)") but i can not read the attribute name ( TB_32_C or TB_32_U)
So question 1 is: How do i read the Attribute NAME?
question 2 is there a way to read only things in the MatchInfo Node? ( if node is the right word)
Thanks so much for any help
|
|
|
|
|
How do i read the Attribute NAME?
Use XmlTextReader
is there a way to read only things in the MatchInfo Node
Use XmlNode
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
my cup runith over
Like i said in my orginal post this is my first time working with XML at all let alone in c#
I got the xml reader part thats how i am able to get the atrubut value. however when you create a new attrubute you give it a Name AND a value
i can read the value of the attrubute but i can not figure out how to get the orginal name ( in this case the textboxs name)
I have no idea what you implying with the use xmlnode
|
|
|
|
|
Why not
<Match Name="TB_32_U" >1-North Carolina (32-2)</Match>
|
|
|
|
|
|
Don't use data for the name of an attribute.
|
|
|
|
|
Hi All,
I have done a windows application which is running very fine. and I made a windows service which is also running fine.
Now my windows service is on system A.
Now my windows application is on system B.
From system A through windows service I have to invoke the windows application on system B which the form consisoting in it.
Right Now Iam able to invoke the process(windows application)which is on system B from windows service which is on on system A.
But the form/pop-up is not opening in system B. but Iam able to see the windows app process in Task manager of system B.
Now how to show form/pop-up of winodws app in system B where it is invoked by system A.
Thanks
Kinldy help me...
|
|
|
|
|
Hi,
If you're invoking a form that you have created, you can add this.Show(); to your remote form constructor, but if you're invoking a windows application "like calc.exe", make sure you dont have your process object hidden property set to true.
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hi,
Im new to .net
Can any help me in getting the [b]resultset of a query in MSACCESS using C#[/b]
THANKS in advance
|
|
|
|
|
|
i have added dynamically ToolStripMenuItem to ToolStripDropDownButton in my button click event the code is
ToolStripMenuItem Test = new System.Windows.Forms.ToolStripMenuItem();
Test.Text = "Hello" + i;
Test.Tag = "Hello" + i;
toolStripButtonUndo.DropDownItems.Add(Test);
i++;
this code is working fine but there is a event called ToolStripDropDownButton_DropDownItemClicked in that event i was trying to remove the ToolStripMenuItem on which user has clicked but not getting success because i did not work before with ToolStrip so that is why i have lack of knowledge in ToolStrip in .net v2.0. so plzz help me in such a way as a result i will be able to remove dynamically ToolStripMenuItem from ToolStripDropDownButton in the event called ToolStripDropDownButton_DropDownItemClicked. so plzz help me with small code snippet if possible. i will be looking forwar for fast response.
Thanks.
tbhattacharjee
|
|
|
|
|
Hi,
One more question regarding toolstripdropdownbutton.i am giving shortcut keys to the menustrip items,
toolstripdropdownbutton..where as when toolstripdropdownbutton has one or more menustrip items iam unable to expand the toolstripdropdownbutton with the shortcut key.i have given the shortcut key through the designer.pls let me know what shd we do to expand the toolstripdropdownbutton through
shortcut key..
Rgds
YM
|
|
|
|