|
Which programming language do you use? All .NET forms are classes inheriting from the System.Windows.Forms.Form .
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.
|
|
|
|
|
the forms are written using vb.net
to be specific, i wrote another project and i added the projects blablabla...
i want to be able to do the following while i'm in the new project:
Project.Form.show()
can i do this just by adding the project and adding a reference to it?
Know thyself
|
|
|
|
|
Yes you can! I just did it again and added a button to a form:
private void button1_Click(object sender, EventArgs e)
{
WindowsApplication1.Form1 frm = new WindowsApplication1.Form1();
frm.Show();
}
which would look in VB.NET like this:
Private Sub button1_Click(sender as object, e as EventArgs) handles button1.click
frm as new WindowsApplication1.Form1
frm.Show()
End Sub
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,
Iam using Windows based DatagridView..So i want to display the Child View..
and iam adding the TextLinkColumn..So just if i click the TextLinkColumn and displaying the related records in Child DataGridView..
Here i done the coding for displaying child dataGridview..So iam geting error in this Coding part...
already i've done the RelationShip to dataBase Tables
Error is:"Child list for field APPLICATION_DETAILS cannot be created."
here...Declare dtTable- DataTable
private void LocationView(int applicationID)
{
this.Cursor= Cursors.WaitCursor;
APPLICATION locationForm=new APPLICATION();
CurrencyManager cm = ((CurrencyManager)this.BindingContext[dtTable, "APPLICATION_DETAILS.APPLICATION_DETAILSAPPLICATION"]);
IBindingListView list=(IBindingListView)cm.List;
locationForm.ShowDialog(applicationID, this, list);
this.Cursor=Cursors.Default;
}
Pls tel me..now critical situation..
Pls need help..
Somu
|
|
|
|
|
Please can you help me out in this.....
I am having trouble in changing my checkbox backcolor into red when CheckedState is checked, yellow when it's undeterminate and unchecked turns to normal color.
CheckBox Property:
1.ThreeState = true //unchecked,undeterminate,checked
2.CheckedState = unchecked; //unchecked,undeterminate,checked
3.BackColor = System.Control; //normal color
code for the first CheckedState..
checkBoxName.checked = true;
checkBoxName.BackColor = Color.Red;
|
|
|
|
|
All you have to do is handle the CheckStateChanged event of the CheckBox and check the value of the CheckBox's CheckState property. Set the BackColor accordingly.
|
|
|
|
|
I'm trying to add a StringCollection to the resources of my application.
In the VS Resource Editor there is a section called "Other" and accourding to the MSDN article it is possible to add any type that supports serialization, but I'm unable to do it. The grid is inactive.
Does anybody know a solution to the problem?
|
|
|
|
|
Hi,
Please try the following steps toadd a string resource.
1) With a project selected in Solution Explorer, on the Project menu, click Properties.
2) Click the Resources tab. On the Resource Designer toolbar, point to the resource view drop-down, click the arrow, and make sure it is set to Strings (which is the default). A settings grid will appear, displaying the strings maintained by that instance of the Resource Designer.
3) Click on the Name column of the last row in the grid, which is marked with an asterisk (*).
4) In the Name column, enter a name for the string.
5) In the Value column, enter the string to be used as a resource.
6) Optionally, enter a comment in the Comment column.
Hope this helps .
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
I am using Windows DataGridView....
How to Display the Parent With Child View
iam using TextLinkColumn..So if i Click the TextLinkColumn and displaying the Child View from another Table.
So Pls any example...
pls tel me..
Regards
Somu
|
|
|
|
|
internal Lybra.Forms.Controls.GradientPanelXP pnlHeader;
i declared like this
but i got error.
the type or namespace name"lybra"couldnot be found...
what should i do?
|
|
|
|
|
the compiler is saying it doesn't know what the Lybra namespace is.. make sure that you have a reference added to your project to the DLL you are trying to use. If you don't have the DLL, or don't know what I mean, then you might want to talk to the creator of the control you are trying to use.
|
|
|
|
|
You have to add a reference to the lybra namespace, as the other poster said.
"I really like comments where I don't have to answer stupid questions" - stfx
|
|
|
|
|
Actually.i want to display the Child Datagrid form Access Database table
iam using the coding:
CurrencyManager cm = ((CurrencyManager)this.BindingContext [dtTmp,"APPLICATION_DETAILS.APPLICATION_DETAILSAPPLICATION"]);
Iam getting this Error!!!!
"Child list for field APPLICATION_DETAILS cannot be created."
Pls tell me
somasundaram
|
|
|
|
|
Quit reposting the same question. It doesn't make anyone answer your question any faster.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi everyone,
For a windows application that we are developing, there is a datagridview that holds the list of users in the system.... The datagridview should support sorting and also , the datgridview will be updated whenever a user is added to the system.
In such a scenario, which is the better option -
1) Using a BindingList as the Datasource to the gridview , update the bindinglist and call the ResetBindings to update the grid
OR
2) Use the DataGridView.Rows.Add / insert method to add rows
|
|
|
|
|
If your application is built using DataBinding then you have to use your first approach: always modify the data and reflect them by the UI,otherwise you will possibly get some nasty binding problems.
The second approach is useful if you use a model-view-presenter (or similar) model to fill the data into the DataGridView in the View.
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
The issue is that we are get frequent updates to the GridView , as far as i know , the ResetBindings will reread all the items in the list and refresh their displayed values. Will that be a performance issue
|
|
|
|
|
so here quick and dirt code to illustrate problem i have.
PROBLEM: when you have controls more that few, it tooks a lot of time for redraw them all.
this redrawing it visible and horrible.
even if you using custom control with (i think) faster repaint, it nosense...
so, maybe there's some styles or properties or something to make it faster?
or some other techniques?
--
yours,
mrRobot.
-- modified at 6:29 Monday 17th September, 2007
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.
using System;
using System.Drawing;
using System.Windows.Forms;
namespace custCompTest2
{
public class custCompTest2 : Form
{
public custCompTest2()
{
this.Name = "custCompTest2";
this.Text = "custCompTest2";
this.ClientSize = new System.Drawing.Size(400, 400);
for(int n=0; n<800; n++)
this.Controls.Add( (new tgC()) );
}
protected override void OnSizeChanged(EventArgs e)
{
this.SuspendLayout();
int x=0, y=0, w=Width/40, h=Height/21;
foreach (Control c1 in Controls)
{
c1.Location = new Point(x,y);
c1.Size = new Size(w,h);
if(x+w*2+1<Width) { x+=w; } else { x=0;y+=h; }
}
this.ResumeLayout(false);
}
protected override void OnLoad(EventArgs e)
{
this.OnSizeChanged(e);
}
[STAThread]
static void Main()
{
Application.Run(new custCompTest2());
}
}
public class tgC : Control
{
public tgC()
{
this.SetStyle(
ControlStyles.UserPaint |
ControlStyles.AllPaintingInWmPaint |
ControlStyles.DoubleBuffer |
ControlStyles.ResizeRedraw
, true);
}
protected override void OnPaint(PaintEventArgs e)
{
Graphics g = e.Graphics;
g.DrawRectangle(Pens.Black, 1,1, Width-2, Height-2);
}
}
}
|
|
|
|
|
MrRobot wrote: for(int x=0; x {
for(int y=0; y {
How many Controls are there? (part of your source, starting with a less-than sign, got eaten
by the HTML interpreter)
Is this the actual code that is slow, or just something that looks like it?
Is it really the painting that is slow (try minimize-restore), or just the loading of the form?
IMO UserControls don't help speeding up the painting.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
hi,
sorry posting problems, me first time at codeproject.
i updated post. so, as you can see Controls are lot.
and with resizing it looks so ugly.
i still don't know is it possible speedup this some realy custom hints like WndProc or not...
|
|
|
|
|
Hi,
your tgC control is very simple, making it DoubleBuffered won't help;
you might try to make its container (the Form) DoubleBuffered though (that is where
the complexity is, due to the high number of Controls).
Why do you need/want tgC Controls in the first place? if all they do is draw a Rectangle,
they are not worth the trouble. This is what I would do:
- eliminta tgC class;
- add a Panel to the Form;
- make that Panel double-buffered;
- give it an OnPaint that draws all required shapes;
- if other events on tgC were going to be used, implement them on the Panel instead;
e.g. write simple code to convert a Panel.MouseClick to a Click in the right rectangle...
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
i already wrote sort of tgC class before post message. and it's ok with calculating mouse. was working until i realize i need tooltip and some other standart things. this is problem. seems it's also possible to do,
but also it seems stupid to reimpliment some things already exist. heh.
|
|
|
|
|
Using Controls is comfortable but does not lead to the highest performance, the choice
is yours.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
no doubt. but comparing mfc application i have here with about ~500 controls it possible to guess winforms 100 times slower or it working some different way... hmm, strange...
|
|
|
|
|
The Control class in the .NET Framework is a bit heavier than the base class in MFC. Putting 800 controls on a form will take forever to render, no matter what you do. Even then, the MFC code is probably not using true "controls", but lighter-weight custom windows, or a rendering engine.
Think of the number of WM_PAINT messages going to all those windows. That's 800 seperate paint events. In the case of user controls, even worse, since the paint event is going to the user control, then there's another paint event fired for the child controls of the user control. Things are getting ugly pretty fast, aren't they?
The less controls you have, the better, period. Under 50 controls and you'd be doing much better.
|
|
|
|