Click here to Skip to main content
15,920,438 members
Home / Discussions / Windows Forms
   

Windows Forms

 
AnswerRe: Slow repaint of controls Pin
Luc Pattyn16-Sep-07 22:51
sitebuilderLuc Pattyn16-Sep-07 22:51 
GeneralRe: Slow repaint of controls Pin
MrRobot17-Sep-07 0:50
MrRobot17-Sep-07 0:50 
GeneralRe: Slow repaint of controls Pin
Luc Pattyn17-Sep-07 1:19
sitebuilderLuc Pattyn17-Sep-07 1:19 
GeneralRe: Slow repaint of controls Pin
MrRobot17-Sep-07 2:57
MrRobot17-Sep-07 2:57 
GeneralRe: Slow repaint of controls Pin
Luc Pattyn17-Sep-07 2:59
sitebuilderLuc Pattyn17-Sep-07 2:59 
GeneralRe: Slow repaint of controls Pin
MrRobot17-Sep-07 5:44
MrRobot17-Sep-07 5:44 
GeneralRe: Slow repaint of controls Pin
Dave Kreskowiak17-Sep-07 13:54
mveDave Kreskowiak17-Sep-07 13:54 
GeneralRe: Slow repaint of controls Pin
MrRobot17-Sep-07 21:45
MrRobot17-Sep-07 21:45 
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 {
    
    /** Creates new form jframef */
    public jframef() {
        initComponents();
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    private void initComponents() {//GEN-BEGIN: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();
    }//GEN-END:initComponents

    private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
        // Add your handling code here:
        this.setLayout(null);
        this.setSize(400,400);

//        for(int n=0; n<800; n++) {this.add( new Button() );}
        for(int n=0; n<800; n++) {this.add( new tgC() );}
    }//GEN-LAST:event_formWindowOpened

    private void formComponentResized(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentResized
        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");
    }//GEN-LAST:event_formComponentResized
    /** Exit the Application */
    private void exitForm(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_exitForm
        System.exit(0);
    }//GEN-LAST:event_exitForm
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        new jframef().show();
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables
}

// Custom component
class tgC extends java.awt.Component {
    public void paint(Graphics g){
        g.drawRect(1, 1, getBounds().width-2, getBounds().height-2);
    }
}

AnswerRe: Slow repaint of controls Pin
MrRobot17-Sep-07 0:28
MrRobot17-Sep-07 0:28 
QuestionToolstrip control Work like toolbox in vs2005 Pin
VB 8.013-Sep-07 20:33
VB 8.013-Sep-07 20:33 
QuestionImage Background in a RichTextBox Pin
Stige13-Sep-07 11:52
Stige13-Sep-07 11:52 
AnswerRe: Image Background in a RichTextBox Pin
DigiOz Multimedia16-Sep-07 12:49
DigiOz Multimedia16-Sep-07 12:49 
QuestionWebBrowser Control. Urgent. Pin
Elizma13-Sep-07 6:18
Elizma13-Sep-07 6:18 
AnswerRe: WebBrowser Control. Urgent. Pin
Paul Conrad26-Sep-07 16:18
professionalPaul Conrad26-Sep-07 16:18 
QuestionRunTime How to Set A Object Type Pin
M.Sathiskumar13-Sep-07 0:49
M.Sathiskumar13-Sep-07 0:49 
AnswerRe: RunTime How to Set A Object Type Pin
Lutosław17-Sep-07 4:40
Lutosław17-Sep-07 4:40 
QuestionUser Control with container area? [modified] Pin
MrBean12-Sep-07 23:23
MrBean12-Sep-07 23:23 
AnswerRe: User Control with container area? Pin
Lutosław13-Sep-07 7:13
Lutosław13-Sep-07 7:13 
GeneralRe: User Control with container area? Pin
MrBean13-Sep-07 21:19
MrBean13-Sep-07 21:19 
AnswerRe: User Control with container area? Pin
Patrick Etc.19-Sep-07 16:54
Patrick Etc.19-Sep-07 16:54 
GeneralRe: User Control with container area? Pin
MrBean19-Sep-07 23:22
MrBean19-Sep-07 23:22 
QuestionHow to show a calendar in wpf Pin
sarodam11-Sep-07 19:37
sarodam11-Sep-07 19:37 
QuestionNeed information on Form.resx files. Pin
Preston McCormick11-Sep-07 13:28
Preston McCormick11-Sep-07 13:28 
QuestionSimple question about button on windows forms Pin
maglev_tgv10-Sep-07 22:18
maglev_tgv10-Sep-07 22:18 
AnswerRe: Simple question about button on windows forms Pin
ChandraRam11-Sep-07 0:02
ChandraRam11-Sep-07 0:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.