|
How do I draw on a panel?
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
Dont draw on panel.
Whenever ur object g is ready,
just say pnlGraph.Add(g);
Nana
|
|
|
|
|
I am using WebControls, it does not have a method Add. How do I do it on a web panel?
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
pnlGraphic.Controls.Add(g);
Nana
|
|
|
|
|
Graphics is not a control.
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
send me entire code.
whats contop?
Nana
|
|
|
|
|
public void DrawBorder()<br />
{<br />
Bitmap draw = new Bitmap(intTableWidth, intTableHeight);<br />
Graphics g = Graphics.FromImage(draw);<br />
<br />
g.DrawImageUnscaled(topleft, 0, 0);<br />
g.DrawImageUnscaled(topright, intTableWidth - 12, 0);<br />
g.DrawImageUnscaled(bottomleft, 0, intTableHeight - 12);<br />
g.DrawImageUnscaled(bottomright, intTableWidth - 12, intTableHeight - 12);<br />
<br />
for (int i = 12; i <= intTableWidth - 12; i++)<br />
{<br />
g.DrawImageUnscaled(contop, i, 0);<br />
g.DrawImageUnscaled(conbottom, i, intTableHeight - 12);<br />
}<br />
<br />
for (int i = 11; i <= intTableHeight - 12; i++)<br />
{<br />
g.DrawImageUnscaled(conleft, 0, i);<br />
g.DrawImageUnscaled(conright, intTableWidth - 12, i);<br />
}<br />
<br />
draw.MakeTransparent(Color.Transparent);<br />
draw.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);<br />
<br />
g.Dispose();<br />
draw.Dispose();<br />
}
And
<br />
<br />
private Bitmap topleft;<br />
private Bitmap topright;<br />
private Bitmap bottomleft;<br />
private Bitmap bottomright;<br />
private Bitmap contop;<br />
private Bitmap conbottom;<br />
private Bitmap conleft;<br />
private Bitmap conright;<br />
<br />
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
I am working on an application that is a card based computer game. In the application there are playing cards made out of controls, and each of the control is an element of a control array. Each of the cards must be able to be a child to another card and/or a parent control to another card.
This creates a situation in which any control could be dragged onto another control based upon compliance with the rules of the game. However, the problem occurs when there is the capability to drag a parent control onto an already placed child control.
Here is the problem. When a child is dragged onto its parent control it generates the error: "A circular control reference has been made. A control cannot be owned or parented to itself."
How do I resolve this circular control reference or completely prevent the possibility of a child control from being dragged onto its parent in the first place?
The code for the DragOver event for each of the controls is as follows:
private static void _ctrlParent_DragOver(object sender, DragEventArgs e)
{
try
{
if ( DragDropHandler.CanDropHere((Control)sender, e.Data) )
{
Control cthis = (Control)sender;
e.Effect = DragDropEffects.Move;
Control ctrl = DragDropHandler.GetControl(e.Data, true, true);
if (!(ctrl is IDragDropEnabled))
{
return;
}
if (cthis.Name != ctrl.Name)
{
ctrl.Parent.Controls.Remove(ctrl);
ctrl.Parent = cthis;
cthis.Controls.Add(ctrl);
ctrl.BringToFront();
Point NewLocation = cthis.PointToClient(new Point(e.X, e.Y));
ctrl.Left = NewLocation.X - dragPoint.X;
ctrl.Top = NewLocation.Y - dragPoint.Y;
}
else
{
return;
}
}
else
{
e.Effect = DragDropEffects.None;
}
}
catch (Exception ex)
{
MessageBox.Show("Error is " + ex.Message);
}
}
NOTE: When the child control is dragged onto the parent control, both controls disappear from the screen because of the circular reference error generated. How is a test performed to prevent a circular reference when it is necessary to have the potential to be both a child and a parent control?
-- modified at 20:50 Sunday 25th February, 2007
|
|
|
|
|
Hi,
Does anyone know where I can find out how to change the colours of the column header row in a listview?
I can't find anything on the net at all.
Cheers,
Glen Harvy
|
|
|
|
|
I want to use an Xml file as my config file, i know how to read the data from the file, but wondering if there is a way to update just one field of the xml with out creating a new xml file. If someone can point me to an example or the xml command to use.
Thanks
Rob
|
|
|
|
|
Use the XmlDocument class, and an XPath with SelectSingleNode to find the node you want to update.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
In my efforts to teach myself the C# programming code, I want to collect as many C# Algorithms as I can
in my database, so I can develope as many small but useful programs as I can for my self and others who wish to share with me , and me with them.
Any great algorithms just sitting around, that I can capture and use.
Psudocode as well if possible.
Thanks much in advance.
Ron in Minneapolis, MN USA
Much success to you.
|
|
|
|
|
|
HI,
Hope i will be one in making your such database. That will certainly help to C# self Learners.
Could u please give me Name of few algorithm that u desirous to put in your database, So that i may send u some Code with Algorithm.
All the Best.
Binod K.
|
|
|
|
|
I want to add a dll, an API belongs to the software NETICA,i add him in References > Add References > Comtab > Netica object Library Ver 1.0;
What is that I has to not use the other thing? Knowing that this library is used C and C ++ there, there is an example C ++ which uses Netica.h, Netica.lib, Netica.dll and NeticaEx.h, the problem that when i write net_bn* net; who was true in C++, but he undeline error:The type or namespace name 'net_bn' could not be found (are you missing a using directive or an assembly reference?) , i know that they are a difference on C++ and C# syntax but the API was for C , C++ and C#
Thank you
|
|
|
|
|
The error message gives you the solution. It suggests that there is a reference or a using directive missing. As you have added the reference, it's the using directive that is missing.
---
single minded; short sighted; long gone;
|
|
|
|
|
Can you explain me, i don't know how i resolve this problem, thank you very mutch
|
|
|
|
|
Did you happen to notice all the using directives at the top of your code? You're missing the one that imports the namespace in the .DLL you referenced.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
You don't create a pointer in C#. Probably net_bn is wrapped in a namespace which you need to reference.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
Hello everyone,
I have created a Windows Application which have TabControl. I was wondering how I can fire a particular TabControl once a Button is clicked.
Thank you very much for your help.
Khoramdin
|
|
|
|
|
Hello,
Khoramdin wrote: I was wondering how I can fire a particular TabControl
I have no idea what you mean with "fire".
Let me give an answer out in the blue.
If you mean "activate" when you say "fire", and if you mean TabPage instead of TabControl,
then you could use the TabControl property "SelectedIndex".
Hope it helps!
All the best,
Martin
|
|
|
|
|
|
Well, it's plainly not 1 or 3. I'm not sure what 4 means, but I doubt it's that. It must be 2, although I have no idea what that means, either.
Reflection allows you to look at private variables, I believe. But, a type safe variable just means a variable that is typed. A variable is just
int x;
that has no features at all, it's just a variable. So, I assume they mean a property, not a variable. The question itself is retarded, IMO.
If it's a property, then you can do this:
int x
{
get
{
return myPrivateInt;
}
}
but, type safety has nothing to do with it, this would work if x was of type object. And, if this is called 'code access control', that's not a term I've ever heard.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
Zealous_Me wrote: Which feature of a type safe variable allows the variable to access a value from the private field of an object ?
Zealous_Me wrote: 2.) Code access control
I agree with Christian - The question is CAC
|
|
|
|
|
Hello experts,
I've written a producer/consumer class which I will be using in my current project.
Here's a snippet of my class:
private Queue<NextDataReply> packs;
private bool productionDone;
private void Enqueue(NextDataReply pack)
{
lock (packs)
{
packs.Enqueue(pack);
Monitor.PulseAll(packs);
}
}
public NextDataReply Dequeue()
{
lock (packs)
{
while (packs.Count == 0 && !productionDone)
Monitor.Wait(packs);
if (productionDone) return null;
return packs.Dequeue();
}
} AFAIK, this is the accepted and prefered way to go about synchronizing queue access.
However, I can't figure out something...
Consider the following scenario:
The consumer has called Dequeue() , and is now blocking on Monitor.Wait() , waiting for data to be added to the queue.
The producer has now called Enqueue() and has reached the lock statement.
Isn't this a deadlock situation?
The way I see it, the consumer has aquired the lock for the packs object, and calls to lock would block until the consumer has exited the critical section of Dequeue() (which never happens, as it is blocking on Wait() ).
Explain it to me please...
|
|
|
|