|
hmmm..I'll try it.
Mazy
No sig. available now.
|
|
|
|
|
I would like to make a usercontrol with a datasource. How is this possible?
|
|
|
|
|
Inherit your control from ListControl. It contains the base implementation for binding a control to a list. If you just want to bind your control to a single value, take a look at the Control.DataBindings property.
|
|
|
|
|
Okay,
I am doing Conway's Life on my own to get familiar with doing graphic drawing. I have a picture box named world. I have a routine NewView() which will
- create a black pen (death), blue pen (birth), and red pen (living)
I was planning to just draw points on the pictureBox for each point in the 500x500 array area. Unfortunately I am lost as to just how to start out. I know I create my System.Drawing.Pen(Color.Black), etc. and I think I have to create a System.Drawing.Graphic object. But beyond that I'm lost as to the next step to have that Graphic bound to the pictureBox and having the points drawn.
Any help and tutorials that can step me through it (in C#) would be appreaciated!!!
Thanks,
MJ
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
theRealCondor wrote:
I know I create my System.Drawing.Pen(Color.Black), etc. and I think I have to create a System.Drawing.Graphic object. But beyond that I'm lost as to the next step to have that Graphic bound to the pictureBox and having the points drawn.
Override the OnPaint method and use the Graphics object provided.
leppie::AllocCPArticle(Generic DFA State Machine for .NET);
|
|
|
|
|
Well....I cannot override a method of a control in my form from my form. But that was the start of my searching.
First I hooked into the Paint event for the control and used control.Invalidate() to fire that event. It worked somewhat but I had a result that was not all that visible and I was having problems drawing points.
My second attemt did work though which I extended from the DrGUI article on doing Conway's Life.
I created a Bitmap object Bitmap img; , created a graphics object Graphics g = Graphics.FromImage(img); then I just set my pictureBox.Image = img once I drew my graphics inside the image. Works great.
Now all I have to do is get factor in form resizing, image scaling, and I have it all done!
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
Hi guys,
My application opens and saves files in a particular format. I have added the entries in the registry to associate this file type with my application (by extension). When you double-click one of these files in Windows Explorer, my application launches which is great. Now, how do I get the path of the file that was clicked? I've checked the arg[] passed into the Main method and it's not there. How do I get it so I can open the file? Also, how can I open the clicked file in a currently running instance of my application?
Thanks in advance
Andy
|
|
|
|
|
BigAndy wrote:
I've checked the arg[] passed into the Main method and it's not there.
Of course its there. Whats your code that you check it?
Mazy
No sig. available now.
|
|
|
|
|
Oh no they're no...
static void Main(string[] Args) <br />
{<br />
StreamWriter objSW = new StreamWriter("C:\\Args.txt", false);<br />
objSW.WriteLine("Args Start------");<br />
for(int x = 0; x < Args.GetLength(0); ++x)<br />
{<br />
objSW.WriteLine(Args[x]);<br />
}<br />
objSW.WriteLine("Args End------");<br />
objSW.Close();
.....
The file (Args.txt) has the "Args Start------" line and the "Args End------" line but nothing in between. Any ideas? I'm using Windows XP Pro.
Andy
|
|
|
|
|
How did you create the registered extention?
Your example works fine here.
Rocky Moore <><
|
|
|
|
|
OK, I found the problem. The exe path in the registry needs to have a %1 after it to denote the file path ("C:\Program Files\A Folder\Program.exe" "%1"). Thanks for the help.
|
|
|
|
|
hi,
if any one has seen the code given for the MIDI and compiled the same it gives an error of some header file .Can you suggest form where to get that dmusicc.h file.
also if it could be clarified if MIDI can be accessed by another Application Software.If,yes how is it possible?
Regards
design engg
|
|
|
|
|
You seem to be in the wrong area. This the C# not C++.
The file is a DirectX and would be were ever you installed the SDK.
Rocky Moore <><
|
|
|
|
|
I found an awesome licensing product for .NET
Take a look at it http://www.xheo.com/Products/Licensing/[^]
Just a few months back I couldn't find anything that would support .net
Does anyone know of any other similar products?
|
|
|
|
|
I am using getValues
lets say in SQL its a bit field which I believe is a SqlByte class I think
and lets say the field is a boolean
Is there anyway using getType and the like to do autmatic conversion without using switch statements to determine the type.
a way using reflection to query the two types and convert them to the compatible type?
links or examples most welcome
nick
|
|
|
|
|
the SqlDataReader GetValues method by the way
|
|
|
|
|
How do I make a list box automaticly scroll down to the bottom of the list?
/\ |_ E X E GG
|
|
|
|
|
Are you talking about just items that have been added or selected? If you select the last item it should scroll into view.
Rocky Moore <><
|
|
|
|
|
No, automaticly...
without any user interaction.
/\ |_ E X E GG
|
|
|
|
|
eggie5 wrote:
No, automaticly...
Not sure what you mean by "Automatically". A listbox does not automatically scroll. When you add an item to your listbox (which you get from somewhere), you would have to do at :
myListbox.SelectedIndex = myListbox.items.Add("LastItem");
This would have the listbox scroll the item you add into view.
Rocky Moore <><
|
|
|
|
|
hi,
would anyone give me some idea how i can check if an application running by C# like using FindWindow in VC++?
thanks,
jim
|
|
|
|
|
Why not use FindWindow in C#?
[DllImport("user32.dll")]
private static extern IntPtr FindWindow(
string lpClassName,
string lpWindowName);
"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
|
|
|
|
|
does it a good practice using unmanaged module?
i seldom use p-invoke. any idea?
thanks,
jim
|
|
|
|
|
If you're wanting easy cross-platform capabilites, wou might not want to use the Windows API. Otherwise, it's just fine.
"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
|
|
|
|
|
Try the Win32Window class at
http://www.gotdotnet.com/team/csharp/code/default.aspx
|
|
|
|