|
I'll look into double buffering. If anyone else has ideas or suggestions please chime in.
Oh, and by "it's standard with .NET" do you mean that this is well known and people are just putting up with it?
|
|
|
|
|
I am still looking for a way to refresh multiple controls on the screen at the same time.
I have tried using double buffering. This works well for a single control that uses various graphics drawing methods. But sub-controls still refresh on the screen independently of each other and their container.
I have tried using WM_SETREDRAW windows message to turn off and back on updating of a control. This requires an invalidate or refresh afterward. The redrawing of the control and sub-controls still occur independently of each other.
Has anyone found any way to make a form and all of its sub-controls update on the screen at the same time? Any help is greatly appreciated.
|
|
|
|
|
Hi
I am populating a List<lisviewitem>. When i add this list to ListView it generates error. Sample is below:
List<listviewitem> lstItems = new List<listviewitem>();
ListViewItem item = null;
listView1.Items.Clear();
listView2.Items.Clear();
listView1.BeginUpdate();
listView2.BeginUpdate();
item = new ListViewItem("<<All>>");
item.Tag = 0;
lstItems.Add(item);
item = null;
for (int i = 0; i < DS.Tables["Table"].Rows.Count; i++)
{
item = new ListViewItem(DS.Tables["Table"].Rows[i]["Column1"].ToString());
item.Tag = DS.Tables["Table"].Rows[i]["Column2"];
lstItems.Add(item);
item = null;
}
listView1.Items.AddRange(lstItems.ToArray());
listView1.EndUpdate();
listView2.Items.AddRange(lstItems.ToArray());
listView2.EndUpdate();
listView1.Items[0].Checked = true;
listView2.Items[0].Checked = true;
lstItems = null;
Can anybody provide a better solution for this.
|
|
|
|
|
Welcome to CodeProject
You need to read the posting instruction for posting code like HTML, XML and Generics because they all use the '<' and '>' characters which require special handling since this forum is a Web based forum and therefore uses HTML which is a tag based language.
Also you can say things like:
Member 3875850 wrote: it generates error
You should post the exact error message and any other relevant information.
led mike
|
|
|
|
|
I want to store subscript and superscript like H20, H2SO4, 6th in sql server and also vb.net windows application also..
i'm using vb.net2005 ..
Please help me......... its urgent.
Bye
K.Mani
kanmani84@gmail.com
By
K.mani
|
|
|
|
|
kannanmani wrote: its urgent.
That's just plain rude.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
kannanmani wrote: Please help me......... its urgent.
Nope. It doesn't even make my top 10000 of urgent things to do today.
|
|
|
|
|
A string stores characters in some encoding, such as ASCII or Unicode.
Normally there is no formatting information, unless your string will be consumed by
a program that knows how to handle formatting (e.g. a PostScript document and a PS reader).
Simple stuff may be available in Unicode, and for sub/superscript digits you're in luck:
http://en.wikipedia.org/wiki/Unicode_subscripts_and_superscripts[^]
BTW make sure your database field accepts Unicode text.
BTW2: I fail to see how this fits this Windows Forms forum.
|
|
|
|
|
When hosting the WebBrowser control (in IE7), is there a setting to prevent it from ever opening a file open or save dialog. (Such as when you are gmail or yahoo mail and adding an attachment.) I'm currently just looking for and closing all child windows, but this is a bit too aggressive.
(Tools|Options|Security Tab|Internet Zone|Custom Settings, Downloads/File downloads/disable doesn't work.)
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Hi...,
I want to close my AboutForm by clicking somewhere, not only on the Form. Is there a general MouseEventHandler?
Thank you,
Michael
|
|
|
|
|
One simple way to achieve this behavior is to use Click event and LostFocus event of the Form. Such as –
---------------------------
Private Sub Form2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click
Me.Close()
End Sub
---------------------------
Private Sub Form2_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LostFocus
Me.Close()
End Sub
----------------------------
I hope this helps.
-Dave.
------------------------------------
http://www.componentone.com
------------------------------------
|
|
|
|
|
Hi Dave,
thank you for this idea. This only works, when the focus goes to another application window. When the focus loses to the parent windows, nothing happens.
I think I still need a more bulletproof solution.
Thank anyway,
Michael
|
|
|
|
|
Hi Everyone I'm doing something where I want to draw multiple controls, without redrawing every time I e.g. resize. The Problem is that I don't want the user to see all the buttons redrawn, every time they e.g. resize the form - any suggestions?...I've tried with double buffering but can't seem to get the hang of it...
Here's an example of how to genereate my problem, then try to resize the form:
public void createButtons()
{
int xlen = 40;
int ylen = 50;
int xpos = 23;
int ypos = 12;
Button[,] buttons = new Button[xlen,ylen];
for (int i = 0; i < xlen; i++)
{
for (int k = 0; k < ylen; k++)
{
buttons[i, k] = new Button();
buttons[i, k].Location = new System.Drawing.Point(xpos, ypos);
buttons[i, k].Size = new System.Drawing.Size(26, 23);
ypos += 20;
this.Controls.Add(buttons[i, k]);
}
xpos += 30;
ypos = 12;
}
}
|
|
|
|
|
CoolAL wrote: int xlen = 40;
int ylen = 50;
2000 buttons? Are you kidding me?
led mike
|
|
|
|
|
Mabye he's building a system for George Jetson to use...gotta make sure that button pushin finger stays strong.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Use the following:
this.SuspendLayout();
this.ResumeLayout();
The SuspendLayout() method Suspends the drawing of the control until the ResumeLayout() method is called. So, call the SuspendLayout() method on the form and add the controls. After adding them, call the ResumeLayout() method on the form.
See the msdn page for SuspendLayout() method for a complete example!
|
|
|
|
|
|
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
It's working fine in Intenet explorer but it is not working in Mozilla firefox.If anybody knows this solution, Please help me.
function runApp(tel)
{
var shell = new ActiveXObject("WScript.shell");
shell.run("C:\call.exe "+tel, 1);
}
Now I need to do the same from out Firefox 2.0 ( Call call.exe file from javascript )
How do I get it done.
|
|
|
|
|
Hey
I am using a windows form in an XNA Game application. The form is displayed when the user clicks on buildings or people within the game world.
However, the game stutter's when the form is been displayed. What I mean by stutter is that it pauses for a brief moment. This is ok if the camera isn't moving, but is very noticeable when it is moving. It seems to only occur when setting the form to visible (i.e. it doesn't stutter when refreshing the form).
The way I display the forms is this. When the game is first loaded, the forms are created and set to be hidden. When the user clicks on an object, the form is set to be visible. Closing the form is in fact just hiding it. I have it this way as it would be faster then creating a new form and destroying it everytime the user clicks on an object.
So, is there anyway to get rid of this stutter or is the method in which I display the form causing the issue.
Any help is much appreciated, Thanks!
|
|
|
|
|
I can't tell you anything definitively so keep in mind that everything I am about to say is a pure guess.
Benzino wrote: or is the method in which I display the form causing the issue.
I doubt that is the cause. It is likely that DirectX rendering is maximizing use of the graphics system so when you attempt to also execute the .NET framework graphics system there is contention for the limited resources that a PC has.
I have spent zero time looking at XNA and not much more with DirectX. However I would guess that to avoid your scenario the DirectX/XNA systems have there own Window/Dialog mechanisms that you should use rather than a .NET Windows Form.
led mike
|
|
|
|
|
thanks for the help. I haven't seen anything other mechanism within xna but i'm sure there most be. thanks.
|
|
|
|
|
Hi, I have a project with 2 groups of buttons and I need assign to event on click to 1 group same piece of code and to 2 group another code. Solving it some component like GroupBox or someone?
|
|
|
|
|
Hi,
you can use the same Click handler for more than one Control.
And if need be, cast sender to the right Control type to find out which Control fired the Click event.
|
|
|
|
|
Can you write that in code please? I need something like this to more powerful code:
NOW:
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
}
private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {
}
...
Future something like this:
button 1-10_Click
|
|
|
|