|
Only by removing/adding from Controls
Hi,
AW
|
|
|
|
|
I have a figure that I want to fill with black color, but it don't work!!
private void button11_Click(object sender, System.EventArgs e)
{
System.Drawing.Graphics formGraphics = null;
System.Drawing.Pen myPen;
formGraphics = pictureBox7.CreateGraphics();
myPen = new System.Drawing.Pen(System.Drawing.Color.Black,1);
formGraphics.DrawLine(myPen, 4, 4, 50, 4);
formGraphics.DrawLine(myPen, 4, 4, 4, 100);
formGraphics.DrawLine(myPen, 50, 4, 50, 100);
formGraphics.DrawLine(myPen, 4, 100, 27, 120);
formGraphics.DrawLine(myPen, 50, 100, 27, 120);
SolidBrush Brush = new SolidBrush(Color.Black);
Point point1 = new Point(4, 4);
Point point2 = new Point(50, 4);
Point point3 = new Point(4, 4);
Point point4 = new Point(4, 100);
Point point5 = new Point(50, 4);
Point point6 = new Point(50, 100);
Point point7 = new Point(4, 100);
Point point8 = new Point(27, 120);
Point point9 = new Point(50, 100);
Point point10 = new Point(27, 120);
Point[] curvePoints = new Point[]
{
point1,
point2,
point3,
point4,
point5,
point6,
point7,
point8,
point9,
point10,
};
formGraphics.FillPolygon(Brush, curvePoints);
myPen.Dispose();
formGraphics.Dispose();
}
Any idea?
|
|
|
|
|
So I'm doing something like :
[Category("Visual"),
DefaultValue(XXXX)
]
public Color MyColor { get{..} set{..} }
What should I put in XXX to get my color initialized correctly .. whatever I put in it, I get a wrong value or color !!
Cheers,
MrPink
|
|
|
|
|
Color.Black is what you want?
Mazy
No sig. available now.
|
|
|
|
|
Well,
[
...
DefaultValue(Color.Black),
]
Does not work 
|
|
|
|
|
What about:
[
...
DefaultValue(KnownColor.Black),
]
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Let me rephrase the question...
/\ |_ E X E GG
|
|
|
|
|
Were you going to rephrase the question in this post or another one?
John
"We want to be alone when we hear too many words and we feel alone when it has been a while since anyone has spoken to us." Paul David Tripp -- War of Words
|
|
|
|
|
funny he lost the thought
|
|
|
|
|
NO. I'm just to damn fustrated with this stupid little thing I need my program to do....
and I don't know how to do it...
it's dumb...
I don't know how...
and I just want someone else to do it...
/\ |_ E X E GG
|
|
|
|
|
then show the xml and describe what your trying to do
|
|
|
|
|
Memory Management
I am using mid form in a windows forms application. Every time I am loading new child windows memory is going up(it’s ok). When I close them memory is not coming down. I am disposing child windows as they close.
Why is this happening ?
What is the solution for this problem ?
What are the best practices for memory management.
Thanks
Gau
Gaurika Wijeratne. //
www.gaurika.com
Every Compounded thing is impermanent
|
|
|
|
|
If you are using task manager to detect memory usage, what you are seeing is the programs working set and not the atuall memory usage.
You say you are using the Dispose method as you close windows. But do those child windows use any resources that are not automatically disposed?
Contrary to popular belief, .NET's automaticall memory management does not imply immediate 100% resource cleanup. Some resources have to be cleaned up manually to decrease memory footprint at any given time since the garbage collector funtions in a non-deterministic way.
|
|
|
|
|
I don’t have any other resources in them . say if I have 20 child windows even after I close all of them, Task Manager dose not reflect it , till I close the MDI main.
Is Task Manager showing the correct memory ?
Any other tool to track memory ?
Gaurika Wijeratne. //
www.gaurika.com
Every Compounded thing is impermanent
|
|
|
|
|
|
how to minize and close form into system tray (application running)
help me!!!
Nho'c ti`
|
|
|
|
|
You have to use NotifyIcon . For more information search it in CP. There is a article about it.
Mazy
No sig. available now.
|
|
|
|
|
How to Create a new Access database using C#?
i want create a new access database.i don't kown how to write the SQL expression.
and i want to kown is there other way to create a new database not use SQL language.beacause i kown there is ADOX in ado2.5 and it can create database.but i can't find anything can create database in ado.net.
thanks.
|
|
|
|
|
I'm interested in knowing too.
The only other technique I know, and have used before, is to embed a blank database into the assembly and write it out to file using a binary stream whenever a new database is needed. I know, its ugly and bad, but it works. Though if you want to be able to create for different Access versions you'd need to embed each one, which is even more ugly and bad.
Also, you can use Interop to access ADOX from C#.
|
|
|
|
|
I think you have to send SQL statement to Access. (CREATE DATABASE ) You can do it in this way with ado.net.
Mazy
No sig. available now.
|
|
|
|
|
Hallo all
I add some Image into ImageList , and Append it to ToolBar, but I can't remove Image background
somebody help me, please
Nho'c ti`
|
|
|
|
|
Here's my ghetto xml (byteFile1.xml)...
<?xml version="1.0"?>
<Bytes>
<byte1>
<one>00</one>
<two>01</two>
<three>02</three>
<four>03</four>
<five>04</five>
<six>05</six>
<seven>06</seven>
<eight>07</eight>
</byte1>
<byte2>
<one>21</one>
<two>15</two>
<three>12</three>
<four>11</four>
<five>05</five>
<six>01</six>
<seven>08</seven>
<eight>04</eight>
</byte2>
<byte3>
<one>02</one>
<two>00</two>
<three>10</three>
<four>18</four>
<five>81</five>
<six>05</six>
<seven>06</seven>
<eight>07</eight>
</byte3>
</Bytes>
now here's the code I process it with...
int nOutNum;
XmlDocument xmlDoc=new XmlDataDocument();
XmlNode bit;
string NUM;
xmlDoc.Load("byteFile1.xml");
bit=xmlDoc.SelectSingleNode("//Bytes/byte1");
NUM=bit.InnerText;
this.labelCell.Text=NUM;
nOutNum=short.Parse(NUM, NumberStyles.AllowHexSpecifier);
NTPort.Outport(nAddress, (short)nOutNum);
Now, what I want to do is go though each node i.e. (one, two, three.... eight) one at a time, and on each one do the above code.
but make ....
bit=xmlDoc.SelectSingleNode("//Bytes/byte1");
unique to the specific node were on in the loop...
like if were on the one in bold...
<byte1>
<one>00</one>
<big><two>01</two></big>
<three>02</three>
<four>03</four>
<five>04</five>
<six>05</six>
<seven>06</seven>
<eight>07</eight>
</byte1>
then change it to...
bit=xmlDoc.SelectSingleNode("//Bytes/byte1/two");
so, it sounds reall confusing... I think all I need is a for loop or somthing... but the changing of the SelectSingleNode thing ruins me...
PLEASE HELP@!@!#@$K
/\ |_ E X E GG
|
|
|
|
|
Don't worry people... I think my question is too confusing to answer also...
/\ |_ E X E GG
|
|
|
|
|
HA, HAHA, I don't need you people... I did it my self.
for (b=1; b<=8; b++)
{
baseBytes="//Bytes";
basebyte1="/byte"+b2;
baseCell="/b"+b.ToString();
baseFULL=baseBytes+basebyte1+baseCell;
XmlDocument xmlDoc=new XmlDataDocument();
XmlNode bit;
string NUM;
xmlDoc.Load("byteFile1.xml");
bit=xmlDoc.SelectSingleNode(baseFULL); //Bytes/byte1/b2
NUM=bit.InnerText;
nOutNum=short.Parse(NUM, NumberStyles.AllowHexSpecifier);
NTPort.Outport(nAddress, (short)nOutNum);
MessageBox.Show("Cell: "+b.ToString()+" illuminated"+"\nByte #"+b2.ToString());
if(b==8)
b2++;
if(b==8)
b=0;
}
MessageBox.Show("LOOP ENDED");
/\ |_ E X E GG
|
|
|
|
|
HA, HAHA, I don't need you people... I did it my self.
for (b=1; b<=8; b++)
{
baseBytes="//Bytes";
basebyte1="/byte"+b2;
baseCell="/b"+b.ToString();
baseFULL=baseBytes+basebyte1+baseCell;
XmlDocument xmlDoc=new XmlDataDocument();
XmlNode bit;
string NUM;
xmlDoc.Load("byteFile1.xml");
bit=xmlDoc.SelectSingleNode(baseFULL);
NUM=bit.InnerText;
nOutNum=short.Parse(NUM, NumberStyles.AllowHexSpecifier);
NTPort.Outport(nAddress, (short)nOutNum);
MessageBox.Show("Cell: "+b.ToString()+" illuminated"+"\nByte #"+b2.ToString());
if(b==8)
b2++;
if(b==8)
b=0;
}
MessageBox.Show("LOOP ENDED");
/\ |_ E X E GG
|
|
|
|