|
so, as mfc layng on winapi, i guessing winforms also using\extending winapi gdi. this way it should be possibility make redrawing faster. or i am wrong? will be great to have answer from winforms developers.
also:
as guessing .net similar to java i wrote kind of same code on java. with same buttons it works some faster but possible to say similar. BUT if instead buttons i'm using custom control(the same primitive tgC drawing rectangle) it's rocket!!!
and for winforms seems nosence is it button or lightweight tgC. it also question to winforms developers.
java tester code(same fast and dirty):
import java.awt.*;
public class jframef extends java.awt.Frame {
public jframef() {
initComponents();
}
private void initComponents() {
addComponentListener(new java.awt.event.ComponentAdapter() {
public void componentResized(java.awt.event.ComponentEvent evt) {
formComponentResized(evt);
}
});
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
exitForm(evt);
}
public void windowOpened(java.awt.event.WindowEvent evt) {
formWindowOpened(evt);
}
});
pack();
}
private void formWindowOpened(java.awt.event.WindowEvent evt) {
this.setLayout(null);
this.setSize(400,400);
for(int n=0; n<800; n++) {this.add( new tgC() );}
}
private void formComponentResized(java.awt.event.ComponentEvent evt) {
int n=0;
int width = this.getBounds().width/41;
int height = this.getBounds().height/21;
for(int x=4; x< this.getBounds().width-width; x+=width) {
for (int y=24; y<this.getBounds().height-height; y+=height) {
if (n<this.getComponentCount())
this.getComponent(n++).setBounds(x, y, width, height);
}
}
System.out.println("DONE");
}
private void exitForm(java.awt.event.WindowEvent evt) {
System.exit(0);
}
public static void main(String args[]) {
new jframef().show();
}
}
class tgC extends java.awt.Component {
public void paint(Graphics g){
g.drawRect(1, 1, getBounds().width-2, getBounds().height-2);
}
}
|
|
|
|
|
as i found here:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2044742&SiteID=1
there is no good solution for this problem. it possible to freeze window/control for repainting, but no speedup at all. sad.
|
|
|
|
|
Hi all ,Presently i am working on a task i.e.,i am having a toolstrip , i added textbox,RB,Label,Checkbox,etc , when i select a control on toolstrip,a run time control has to generate and paste on panel ,But i am not able to drag & drop the control to any place on the panel and make a new selection . And the other thing is when i click a new generated textbox ,it has to show the Textbox edges like in vs toolbox and after that i have to set properties for that runtime generated textbox or radiobutton .Actually, it has to work like VS.Net 2005 Toolbox with some controls on it -- this is actual idea
Waiting for help Urgently---
D.V.Sriram
|
|
|
|
|
Anyone got an idea on how to have a RichTextBox an image as a background?
Thanks in advance
|
|
|
|
|
|
Hi guys and gals.
I need to make use of the WebBrowser control in .NET 2005. I am trying to pass the proxy settings to the Browser but get the following Error Message.
Error Code: 502 Proxy Error. The ISA Server denied the specified
Uniform Resource Locator (URL). (12202)
IP Address: 10.13.67.5
Date:
Server:
Source: proxy
Can someone maybe tell me what the syntax is for using this control.
Regards,
Elizma
|
|
|
|
|
Do not put "Urgent" in your subject line, it really turns most people around here away. Just a friendly pointer
"Try asking what you want to know, rather than asking a question whose answer you know." - Christian Graus
|
|
|
|
|
Hi
RunTime How to Set A Object Type.
< Dim OBJvalue As String = "Yellow"
Dim OBJType As String = "Color">
I have this type two variables..
At run time create a object . that object value is from OBJValue.
That Object Type is What i mention in OBJType Variable...
Sample:
My Object type is Color it is value is yellow.. How i want write code for this
Thanks & Regards,
Sathiskumar.M
|
|
|
|
|
In this specific situation use
string value = "Yellow";
Color c = Color.FromKnownColor((KnownColor)Enum.Parse(typeof(KnownColor), value));
Generally, some type must be able create it's instance from a string. Assuming that it has a constructor which takes a string, you can use following code:
string type = "Temporary.MyType";
string value = "1,2,4";
MyType create = (MyType)Type.GetType(type).GetConstructor(new Type[] { typeof(string) })
.Invoke(new object[] { value });
namespace Temporary
{
public class MyType
{
int[] data;
public MyType(string str)
{
string[] numbers = str.Split(',');
data = new int[numbers.Length];
for (int i = 0; i < data.Length; i++) {
data[i] = int.Parse(numbers[i]);
}
}
public int[] Data
{
get { return data; }
}
}
}
Greetings - Gajatko
Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
|
|
|
|
|
Hi,
I'm developing a WinForms (VB.NET 2.0) application where I have a user control which contains several fixed controls (toolstrip, buttons, panels, etc.).
This works just fine - the problem is that I want one (and only one) Panel control within my user control to act as a container where other controls can be placed in the form designer.
I can set a designer attribute for the entire user control which causes the entire user control to be a container - but I only want one specific Panel control in the user control to act as a container.
How can this be done?
Please help, TIA
/B
-- modified at 5:29 Thursday 13th September, 2007
|
|
|
|
|
|
Getting a user control to act as a container is pretty easy :
After creating a user control in VS 2005, the class code should look something like this:
<br />
Public Class MyUserControl1<br />
<br />
End Class<br />
Just add the following attribute to the class :
<br />
< System.ComponentModel.Designer("System.Windows.Forms.Design.ParentControlDesigner, System.Design", GetType(IDesigner)) > _<br />
Public Class MyUserControl1<br />
<br />
End Class<br />
That should do the trick
If you (or anybody else) find a solution to my problem (read my first post in this thread), please let me know... PLEEEEEESE
/B
|
|
|
|
|
Take a look at my TaskPane control, here:
http://www.codeproject.com/useritems/MSOfficeTaskPane.asp[^]
It does what you're asking. You can see how to set up the designer control properties to get everything to behave the way you want.
The early bird who catches the worm works for someone who comes in late and owns the worm farm. -- Travis McGee
|
|
|
|
|
Thanks for your post, but it doesn't help me.
I only need a user control (not a custom control) where I can control which panel is the container for the .NET form designer.
Also seems like the entire Taskpane control acts like the container and not just a limited area within (panel)... controls can be resized and moved to overlap the toolbarfor example.
/B
|
|
|
|
|
I'm having a trouble with how showing calender in wpf.
I'm looking for windows sdk but no answer.
Please give me some suggestion. Thanks a lot.
|
|
|
|
|
I'm trying to understand form.resx files. Particularly what is put in them and why. I have found plenty of information on resx files in general, but I am looking specifically to understand the relationship between the Visual Studio form designer and the form.resx files.
Most of the little I have seen on the topic says that the file is to facilitate localization and something about storing images for the form. The link to localization is definitely real, since when I select a different location I get another resx file for that location. Based on that, I assume that the default resx file is tied to the default location.
The specific issue that has me interested in this topic is as follows:
I have created a customizable form framework that allows users to filter a huge list of properties down to the ones that they care about. The initial list of properties is generated by reflecting on the business object that the form edits. Another form allows them to shift properties from a list to show and a list to hide. A custom attribute called ControlDescription can decorate the business objects' properties to specify the type of control to show, and additional information such as a domain to populate values in a drop-down list. A FormConfig object keeps all of the form customization settings, which consist of a series of show and hide property lists for the various business objects.
So what does all this have to do with resx files? Well, the forms are serializing the FormConfig object into the resx file. More accurately it is serializing each item in each list into the resx file. These lists are pretty long because the business objects have so many properties, which is why all this madness was developed in the first place. Anyway, I can't figure out why it serializes this particular object into the resx. It seems to be causing problems, because the resx files are getting corrupted on a fairly regular basis.
A typical (slightly absurd) error is:
Object of type 'Us.Fed.Fs.Nris.Nrvs.BusinessObjects.ControlDescription' cannot be converted to type 'Us.Fed.Fs.Nris.Nrvs.BusinessObjects.ControlDescription'.
My hope is, that if I understood what the resx is doing and why, that I can either prevent it from serializing these objects by restructuring the application, or avoid whatever is causing the corruption of the resx files.
Thanks,
Preston
|
|
|
|
|
I created a small windows which has a textbox and a button.
I want to make the cursor is in the textbox when the windows loaded, so users can easily input there. No problem I got to made it. But now I want after user input some text, they could push the button by just press enter on keyboard ( without press tab before enter ).
Which property should I change?
Thx in advance
----------
C++ Learner
|
|
|
|
|
I think there a property AcceptButton on the form which you set to the button you have created. At least that is how it is done in VB.net.
|
|
|
|
|
Yes, there is such property of the Form class
|
|
|
|
|
You would handle the keypress event on the textbox, and if it's a return, you would call the method to close the form.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Using the AcceptButton property on the Form is much easier than this (as long as there is one single global AcceptButton for the Form).
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
Apart from that AcceptsReturn property of the textbox should (and it is by default) be false. Otherwise pressing Enter will insert new line in the textbox
|
|
|
|
|
Hi All,
Iam using Windows Datagridview...So iwant running time automatically ID has to generate.and one more think running time ID should not modify anything.and How to create a New row...So pls tell how to do...
Somasundaram
|
|
|
|
|
Hi Pls
How to delete the Rows through Wizard connection...
thanks
Somasundaram
|
|
|
|
|
Hi,
I am using Datagrid control in WinForms...So iam iam Using command buttons are Insert,Update,Delete,Cancel. so i need coding part for these commands Buttons.So pls help me. this Critical situation..Pls..
thanks
Somasundaram
|
|
|
|