Click here to Skip to main content
15,887,476 members
Home / Discussions / C#
   

C#

 
AnswerRe: Assembly.load Pin
Eddy Vluggen9-Oct-09 2:25
professionalEddy Vluggen9-Oct-09 2:25 
GeneralRe: Assembly.load Pin
PIEBALDconsult9-Oct-09 4:48
mvePIEBALDconsult9-Oct-09 4:48 
GeneralRe: Assembly.load Pin
Eddy Vluggen9-Oct-09 7:45
professionalEddy Vluggen9-Oct-09 7:45 
GeneralRe: Assembly.load Pin
Daniel Grunwald9-Oct-09 6:26
Daniel Grunwald9-Oct-09 6:26 
GeneralRe: Assembly.load Pin
Eddy Vluggen9-Oct-09 8:03
professionalEddy Vluggen9-Oct-09 8:03 
GeneralRe: Assembly.load Pin
Daniel Grunwald9-Oct-09 12:09
Daniel Grunwald9-Oct-09 12:09 
GeneralRe: Assembly.load Pin
Eddy Vluggen10-Oct-09 1:37
professionalEddy Vluggen10-Oct-09 1:37 
QuestionSmooth Moving of TableLayoutPanel control [modified] Pin
Lyon Sun9-Oct-09 1:19
Lyon Sun9-Oct-09 1:19 
Hi, all,
In my Windows Form, there is a TableLayoutPanel control having about 15 rows(column count is not taken into account) and a Button, and in the button_Click event, there are two methods RemoveUpperRow() and AddNewRow() inserted as follows:

modified: Sorry, just noticed there are sth else I need to provide before you check my codes.There are also one label in each cells in the first column, and this is the reason I am able to do rolling by the following codes. Poke tongue | ;-P
private void RemoveUpperRow()
{
    Control c = tlp_MouseArea.GetControlFromPosition(0, 1);
    tlp_MouseArea.Controls.Remove(c);
    tlp_MouseArea.RowStyles.RemoveAt(0);
    //rolling all rows up by 1...
    for (int i = 1; i < tlp_MouseArea.RowCount; i++)
    {
        c = tlp_MouseArea.GetControlFromPosition(0, i+1);
        if (c == null)
            break;
        TableLayoutPanelCellPosition controlPosition = new TableLayoutPanelCellPosition(0, i);
        tlp_MouseArea.SetCellPosition(c, controlPosition);
    }
}

private void AddNewRow()
{
    tlp_MouseArea.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 18F));

    #region new label and its settings
    Label lbl_New = new Label();
    if (int.Parse(tlp_MouseArea.GetControlFromPosition(0, 13).Text) < 15)
    {
        lbl_New.Text = Convert.ToString(int.Parse(tlp_MouseArea.GetControlFromPosition(0, 13).Text) + 1);
    }
    else
        lbl_New.Text = "0";
    lbl_New.Dock = DockStyle.Fill;
    lbl_New.Font = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Pixel, ((byte)(0)));
    lbl_New.TextAlign = ContentAlignment.MiddleCenter;
    #endregion

    TableLayoutPanelCellPosition pos = new TableLayoutPanelCellPosition(0, 14);
    tlp_MouseArea.SetCellPosition(lbl_New, pos);
    tlp_MouseArea.Controls.Add(lbl_New);
}


My problem is that it works fine, but it seems to be too slow, and the whole form is flicking till the end, that's something nobody would want to see. So, is there anything wrong with my code? Would you give me some suggestions? Your kind help is so much appreciated!

Liang

modified on Friday, October 9, 2009 7:26 AM

AnswerRe: Smooth Moving of TableLayoutPanel control Pin
stancrm9-Oct-09 2:13
stancrm9-Oct-09 2:13 
GeneralRe: Smooth Moving of TableLayoutPanel control [modified] Pin
Lyon Sun9-Oct-09 2:32
Lyon Sun9-Oct-09 2:32 
GeneralRe: Smooth Moving of TableLayoutPanel control Pin
Dave Kreskowiak9-Oct-09 3:36
mveDave Kreskowiak9-Oct-09 3:36 
GeneralRe: Smooth Moving of TableLayoutPanel control Pin
Lyon Sun9-Oct-09 9:34
Lyon Sun9-Oct-09 9:34 
Questionuseof custom validation Pin
atiskumar9-Oct-09 0:36
atiskumar9-Oct-09 0:36 
QuestionRe: useof custom validation Pin
harold aptroot9-Oct-09 0:43
harold aptroot9-Oct-09 0:43 
AnswerRe: useof custom validation Pin
atiskumar9-Oct-09 2:47
atiskumar9-Oct-09 2:47 
GeneralRe: useof custom validation Pin
harold aptroot9-Oct-09 5:10
harold aptroot9-Oct-09 5:10 
AnswerRe: useof custom validation Pin
dan!sh 9-Oct-09 0:48
professional dan!sh 9-Oct-09 0:48 
GeneralRe: useof custom validation Pin
atiskumar9-Oct-09 2:25
atiskumar9-Oct-09 2:25 
GeneralRe: useof custom validation Pin
Dave Kreskowiak9-Oct-09 3:33
mveDave Kreskowiak9-Oct-09 3:33 
QuestionHow to call a C# Method from Javascript Pin
Jacobb Michael9-Oct-09 0:12
Jacobb Michael9-Oct-09 0:12 
AnswerRe: How to call a C# Method from Javascript Pin
dan!sh 9-Oct-09 0:32
professional dan!sh 9-Oct-09 0:32 
AnswerRe: How to call a C# Method from Javascript Pin
Nisha Agrawal9-Oct-09 0:42
Nisha Agrawal9-Oct-09 0:42 
AnswerRe: How to call a C# Method from Javascript Pin
Anurag Gandhi9-Oct-09 5:42
professionalAnurag Gandhi9-Oct-09 5:42 
GeneralRe: How to call a C# Method from Javascript Pin
Jacobb Michael10-Oct-09 1:59
Jacobb Michael10-Oct-09 1:59 
Questionhow to update database if i change cell value in datagridview ? Pin
E_Gold9-Oct-09 0:03
E_Gold9-Oct-09 0:03 

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.