|
Sorry, I don't have it lying around, but I have the code for Troll in a Forum
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
what does this mean - "Black holes are the places where God divided by 0..." ??
Blumen
|
|
|
|
|
M.omar wrote: the code of Ant on a Chessboard please...
Don't have that but here is the code for Loser on a Forum
static public class FlameThrower<br />
{<br />
public static void throwflames()<br />
{<br />
Console.WriteLine("LOSER");<br />
}<br />
}<br />
led mike
|
|
|
|
|
|
Hey guys,
Im in the process of creating a 1941-type shooter set in outer space. I have a simple jpeg of distant stars I wanted to set as the background. How can achieve this? And if possible, how can I make it scroll as if my spaceship appears to be moving?
Thanks for any help.
|
|
|
|
|
That's going to be a problem. A scrolling background on a Windows form means that the background will be redrawing every time the image scrolls even one pixel. That will also force a redraw of every control on the form. The more controls you have, the more time it takes to generate a single frame in your game.
The best solution you have is to use DirectX. But, that would require a complete rewrite of your game. You might want to look into Microsoft's XNA Developer's Center[^] first.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
In 2D Games with the tpye you want:
1) There is a screen size background image and you draw onto a part of this big background image and update(Invalidate) just that part so because the user does see only a small portion of the big background image, he thinks he is moving in some directions
2) Have a look at Code4Fun web site, where you can find some tutorials on game development.
Hope this helps...
|
|
|
|
|
I want to allow users to create filters by typing in a textbox the filter they wish to apply to any particular column. I want to apply the filter as the user types it, and I want to apply it as if the displayed value were a string. For example, if I have data with numbers 0-23 associated with it, and a user types the number 1, all data with numbers 1 or 10-19 should still be displayed. So essentially, I want to apply the filter expression "[ID] LIKE '1%'", but when I do this I get the error "Cannot perform 'Like' operation on System.Int64 and System.String". How can I prevent this error without making the filter string something like "[ID] = 1 OR ([ID] >= 10 AND [ID] < 20) OR ([ID] >= 100 AND [ID] < 200) OR ..." (because that would get out of hand)? (I also posted this in ADO because I don't really know where it belongs) Thanks.
-Jeff
|
|
|
|
|
What's the data source you're using? If it's not a database souce, like an Access or SQL database, you can't do filtering. Filtering does not work on every data source, like arrays or lists. You can check the SupportsFiltering property of your BindingSource object to see if the datasource supports filtering.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Its a database. The same code works if the type of column ID is string.
-Jeff
|
|
|
|
|
OK. Well, you can't do a LIKE on a number, not even in SQL. If you were to allow LIKE operations on any field, you'd have to retrieve the data from the database, having it convert all the numeric fields to strings before they get sent to your DataSet. THEN, you can do a LIKE filter on it.
Of course, the problem becomes writing that data back to the database if there are any changes to it. You'd have to have a stored procedure convert the "string" data back to their appropriate data types in the INSET and UPDATE queries.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
i am kind of new to C#, i was wondering if there is a way to find how much is there "red" "blue" and "green" in an image? is there any method for that ?
Thx
Iceman
|
|
|
|
|
icecool_56 wrote: if there is a way to find how much is there "red" "blue" and "green" in an image? is there any method for that ?
Only if you write it. There's nothing in the .NET BCL that will do this for you. Search the articles for "image processing per pixel filters" and you'll find a string of articles by Christian Graus that you can use to built your own method quite easily.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
|
Hi Friends,
I have a requirement for the DataGridView of Windows Forms and is explained as follows:
1. I have a Quantity textbox in the DataGridView.
2. When the user enter the quantity > 1 (say 3), a total of 3 rows should
be added including the current row with the row quantity in all the rows as 1.
3. This should be achieved only when the user hits the Enter key in the
current cell.
4. If the row where the quantity being modified is in the middle of the grid, the rows next to the current row should get re-positioned based on the number of new rows added.
eg:
ProductDesc Qty (TextBox)<br />
Compaq Laptop 3 <br />
DELL DesktopPC 1
When Enter key is pressed in the quantity textbox (for the product Compaq Laptop), the output in the grid should be as follows:
ProductDesc Qty (TextBox)<br />
Compaq Laptop 1 <br />
Compaq Laptop 1<br />
Compaq Laptop 1<br />
DELL DesktopPC 1
I have tried with a couple of existing events of the DataGridView but I couldn't achieve.
Please help me with some suggestions.
Thanks.
Subrahmanyam K
|
|
|
|
|
Most likely, your DataGridView has a DataTable as data source. In this case you have to only add 3 rows in the DataTable. Rows in the DataGridView will appear automatically.
|
|
|
|
|
If your DataGridView is not databound, DataSource = null in this case, then you can use:
DataGridViewRowCollection.Add (Object[]) like:
myDGV.Row.Add(new object[] {"Compaq Laptop", 1});
myDGV.Row.Add(new object[] {"Dell DesktopPC", 1});
BUT, before, be sure that your myDGV has 2 columns with appropriate typers to hold and display your values.
|
|
|
|
|
Please don't cross post in multiple forums. I already answered in the General Discussions forum.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Exe File is deleted but its Process is still exist. Can I determine executable file size from its process on RAM?
|
|
|
|
|
Doan Quynh wrote: Exe File is deleted but its Process is still exist.
That's not possible, AFAIK. Once the .EXE starts, the file remains locked and can't be moved, renamed, opened for write access, or deleted.
Doan Quynh wrote: Can I determine executable file size from its process on RAM?
Nope. There's no correlation between the two sizes. Had you asked about a .COM application, then yes, memory size is equal to code size in the file because .COM files were a memory-image format. How the code looked in RAM was how it looked in the file. .EXE are a segmented and packed format and can very quickly expand way beyond their file size while being loaded.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
I don't thing so.I used VS2005, net frameworrk 2.0,while .exe file started and I can still delete, move or rename it. Other way, I store it in USB, after started it, I remove USB then still only its process.
I wander when .exe32 load, the length of file will load to somewhere on memory?
|
|
|
|
|
Doan Quynh wrote: while .exe file started and I can still delete, move or rename it
Oddly enough, for a Managed Code application (any .NET EXE), this is true. For native code applications, it's not.
Doan Quynh wrote: I wander when .exe32 load, the length of file will load to somewhere on memory?
Nope. It's not saved anywhere. The .EXE is literally unpacked and expanded, vaguely reminicent of a .ZIP file. There is nothing that specifies the original file size.
|
|
|
|
|
Hello everyone,
I am currently using a CSV file to store some data locally on the user's computer. Since these data is only required during the life time of the Windows Application, I was wondering if it is possible to store then in the Menory of the computer in order to speed up the process of dealing with the data contained in the CSV file?
Here is the example of the code I am using:
StreamReader streamReaderOne = new StreamReader("MyListView.txt");<br />
StreamWriter streamWriterTwo = File.AppendText("MyTemp.txt");<br />
while ((line = streamReaderOne.ReadLine()) != null)<br />
{<br />
split = line.Split(delimiterChars);<br />
line = split[0] + "," + split[1] + "," + split[2] + "," + split[3] + ",SAVE";<br />
streamWriterTwo.WriteLine(String.Format("{0}", line));<br />
}<br />
streamWriterTwo.Close();<br />
streamReaderOne.Close();<br />
<br />
File.Copy("MyTemp.txt", "MyListView.txt", true);<br />
File.Delete("MyTemp.txt");
khoramdin
|
|
|
|
|
You can pass it as a parameter to the constructor when you move between forms and the data is accessible to all the forms/class OR you could have a static property and store the data in it and retrieve it from any part of your namespace.
|
|
|
|
|
Hello Tarakeshwar Reddy,
Thanx for your reply. I am slitly confiused here. Do you mean I can pass my entire DATA which can be quiet Large as you mentioned?
Can I ask you to be more detiled with your suggestion or point me to be tutorial which you think and go into details regarding this issue?
Thank you very much and have a great day, mate.
kHORAMDIN
|
|
|
|