|
If you don't want to hard code a firework animation you could possibly create an animated gif file with Animation Shop or a PhotoShop program and just run through the frames at specific time intervals.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
1 - read the FAQ on how to ask questions
2 - unless you're saying you know ALL languages, choose one and learn it, and don't expect to be writing a firework animation in that language for at least 12 months.
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 )
|
|
|
|
|
Stop urgenting people urgently or you'll have a great firework soon
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Muammar© wrote: (\ /)
(O.o)
(><)
What is this?
I can't deside if it is a boxer or a angry lop-sided topless woman with a mole.
|
|
|
|
|
Hi All
I'm Create a Generics class and i need to write a function return lis of object stored on it but i have a problem as following:
I want to compare if the Generics type is the same of the created class and if its the same i want to use a same method and if not the same type of the created class return the object value .
example:
class myList
{
Array MyArray;
public myList()
{
_MyArray=new Array();
}
public void add(T value)
{
_MyArray.add(value);
}
public object[] List
{
//here is the problem
//Array<object> temp=new Array<object>();
//if T is myList<>
//{
// foreach(T item in _MaArray)
// {
// temp.addRange(item .list);//use list method
// }
//}
//else
//{
// foreach(T item in _MaArray)
// {
// temp.addRange((object)item);
// }
//}
}
}
{
myList AList=new myList();
myList BList=new myList();
BList.add(1);
BList.add(2);
BList.add(3);
AList.add(BList);
//BList.list === {1,2,3}
BList=new myList();
BList.add(4);
BList.add(5);
BList.add(6);
AList.add(BList);
//BList.list === {4,5,6}
//AList.list === {1,2,3,4,5,6}
Note:I know there is an exist class List but This is just an example i need to know how can i do the list function that's it
thank you,
|
|
|
|
|
|
thank you Mark
this is the correct code but I need just how can i call a function in this example list for the generics T(((T)item) .list) or use it like the class( myList<t>)
plz reply me as soon as possible
//--------------------------
myList<mylist<int> ///.list =={1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90}
[0]myList<mylist<int>>///.list =={1,2,3,4,5,6,7,8,9}
[0]=myList<int>;///.list =={1,2,3}
[0]=1;
[1]=2;
[2]=3;
[1]=myList<int>;///.list =={4,5,6}
[0]=4;
[1]=5;
[2]=6;
[2]=myList<int>;///.list =={7,8,9}
[0]=7;
[1]=8;
[2]=9;
[1]myList<mylist<int>>///.list =={10,20,30,40,50,60,70,80,90}
[0]=myList<int>;///.list =={10,20,30}
[0]=10;
[1]=20;
[2]=30;
[1]=myList<int>;///.list =={40,50,60}
[0]=40;
[1]=50;
[2]=60;
[2]=myList<int>;///.list =={40,50,60}
[0]=70;
[1]=80;
[2]=90;
//---------------------------
thank you in advance,
example:
class myList<t>
{
Array MyArray;
public myList()
{
_MyArray=new Array();
}
public void add(T value)
{
_MyArray.add(value);
}
public object[] List
{
//here is the problem
//Array<object> temp=new Array<object>();
//if T is myList<>
//{
// foreach(T item in _MaArray)
// {
// temp.addRange(((T)item) .list);//use list method
// }
//}
//else
//{
// foreach(T item in _MaArray)
// {
// temp.addRange((object)item);
// }
//}
}
}
{
myList<mylist<int>> AList=new myList<mylist<int>>();
myList<int> BList=new myList<int>();
BList.add(1);
BList.add(2);
BList.add(3);
AList.add(BList);
//BList.list === {1,2,3}
BList=new myList<int>();
BList.add(4);
BList.add(5);
BList.add(6);
AList.add(BList);
//BList.list === {4,5,6}
//AList.list === {1,2,3,4,5,6}
|
|
|
|
|
No, a generic class would be something like this*
public class MyList<T> : IEnumerable<br />
{<br />
private List<T> m_InternalList;<br />
<br />
}
As in the example, now you have a Generic class that can support a collection of objects in a type-safe manner and gives the ability to iterate through that collection.
*disclaimer: Not 100% complete and acccurate code, just psuedo code so don't complain;P
-- modified at 18:03 Sunday 27th May, 2007
only two letters away from being an asset
|
|
|
|
|
i want to send 6 datas from microcontrol to Visual c# with serialport.i create byte array variable in c# for saving my serial datas.but when i send datas so synchronization problem becomes.every time i see 255 at the first data why?i get datas and i show them to textboxes.what kind of problem can be?
my code is:
serialport_DataReceived(.........)
{
serialport.read(variable,0,6);
}
could be buffer problem?
|
|
|
|
|
Make sure you're addressing the right serial port.
Device Manager > Your serial port > Properties > Resources > I/O Range (Get the range and maybe translate it to Decimal figures)
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
i have to read data from an excel file and compare it with
data from sqlserver ...how can i read data frmo excel into such a strucutre so that i can compare data...
urgent help needed.........
|
|
|
|
|
I'm using VCS Express 2005.
I have a lot of property definitions in different classes like
public class MyEntity {
public string somestringfield {
get { return (string)Row["somestringfield"]; }
set { Row["somestringfield"] = value; }
}
public string someotherstringfield {
get { return (string)Row["someotherstringfield"]; }
set { Row["someotherstringfield"] = value; }
}
}
When template changes I must manually change it in hundreds of places.
I tried to use template
#define StringFieldTemplate( propname ) \
public string propname { \
get { return (string)Row[propname]; } }
set { Row[propname] = value; } \
};
public class MyEntity {
StringFieldTemplate("somestringfield2")
StringFieldTemplate("someotherstringfield2")
}
But got error.
How to implement this ?
Andrus
|
|
|
|
|
I use DataGridView containing DataGridViewComboBoxColumn column.
Combobox column displays dropdown list opening selection triangle in all rows. This covers part of visible data if columns are narrow.
How to force dropdown list opening control to appear only in active (current) row ?
Andrus.
Andrus
|
|
|
|
|
To reproduce
1. Run the code.
2. Open dropdown list
Observed:
Dropdown list width is same as column width
Expected:
Dropdown list width must be greater than column width
How to make dropdown list width greater than column width in DataGridView ?
Andrus.
using System;
using System.Windows.Forms;
class Form1 : Form {
[STAThread]
static void Main() {
try {
Application.Run(new Form1());
}
catch (Exception e) {
MessageBox.Show(e.ToString());
}
}
private DataGridView dataGridView1 = new DataGridView();
public Form1() {
Controls.Add(this.dataGridView1);
Load += new EventHandler(Form1_Load);
}
private void Form1_Load(object sender, EventArgs e) {
DataGridViewComboBoxColumn
col = new DataGridViewComboBoxColumn();
col.DropDownWidth *= 3;
dataGridView1.Columns.Add(col);
}
}
Andrus
|
|
|
|
|
hi
i want to search by string with pattern, but i want to tell to my regex object that ignore some unicode characters or diacritics (such as "ًٌٍَُِّ") in string, but
how to do ?
|
|
|
|
|
Hi!
You can explicitely specify a character not within a range by using ^ as first character in the character selection, for example [^abcl-p] means "any character except a,b,c and l to p" .
HTH,
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hello all,
i've written some code that displays a ball bouncing around inside a windows
form. In an attempt to eliminate the flickering of the ball i copy-pasted this
into the the Form's constructor:
<br />
this.SetStyle(<br />
ControlStyles.UserPaint |<br />
ControlStyles.AllPaintingInWmPaint |<br />
ControlStyles.DoubleBuffer, true);<br />
Now when I try to run the code I get this error message. Does anyone know why? or know another way to stop this flickering. Thanks
Error msg:
********************************************************************************************
System.ArgumentException: Parameter is not valid.
at System.Drawing.Graphics.GetHdc()
at System.Drawing.BufferedGraphics.RenderInternal(HandleRef refTargetDC, BufferedGraphics buffer)
at System.Drawing.BufferedGraphics.Render()
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at WindowsApplication1.Program.Main() in C:\Documents and Settings\Gareth\My Documents\C#\Working_Programs\Bouncing_Ball_With_Gravity\Bouncing_Ball_With_Gravity\Program.cs:line 19
***************************************************************************************************
|
|
|
|
|
hello!
I have 2 problems with a comboBox and a dataGrid.
The first problem is that when i'm selecting a table from the comboBox it's ok, but when i select the second or the third table it's not very good. I have too many lines and columms remaining from the first selected table...i must clear that table or datagrid.
The second problem ... i want that my selected table fit in the dataGrid.
This is my code:
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
alege_tabel = comboBox1.SelectedItem.ToString();
dataSet1.Clear();
SqlCommand sel = new SqlCommand();
sqlDataAdapter1.SelectCommand = sel;
sel.Connection = this.sqlConnection1;
if (alege_tabel == "Oferte")
{
dataSet1.Clear();
sqlDataAdapter1.SelectCommand.CommandText = "select * from Oferte";
sqlDataAdapter1.Fill(dataSet1);
dataGrid1.SetDataBinding(dataSet1, dataSet1.Tables[0].TableName);
}
if (alege_tabel == "Locatie")
{
dataSet1.Clear();
sqlDataAdapter1.SelectCommand.CommandText = "select * from Locatie";
sqlDataAdapter1.Fill(dataSet1);
dataGrid1.SetDataBinding(dataSet1, dataSet1.Tables[0].TableName);
}
if (alege_tabel == "Transport")
{
dataSet1.Clear();
sqlDataAdapter1.SelectCommand.CommandText = "select * from Transport";
sqlDataAdapter1.Fill(dataSet1);
dataGrid1.SetDataBinding(dataSet1, dataSet1.Tables[0].TableName);
}
if (alege_tabel == "Rezervari")
{
dataSet1.Clear();
sqlDataAdapter1.SelectCommand.CommandText = "select * from Rezervari";
sqlDataAdapter1.Fill(dataSet1);
dataGrid1.SetDataBinding(dataSet1, dataSet1.Tables[0].TableName);
}
}
|
|
|
|
|
i wrote this code in Class Librery
DirectoryInfo GetPath = new DirectoryInfo("MD.DAT");
string Path = GetPath.FullName;
this code back the path of the MD.DAT file
but if i use a openfiledialog befor i call this code
it back the path of the openfiledialog
how can i soleve this problem
MD_NADA
|
|
|
|
|
Without seeing your code it is difficult to help you out, but I am guessing that you are setting your Path variable when the openfiledialog returns.
Note you can also use FileInfo to get the path of a file.
Ben
|
|
|
|
|
Hi,
when you specify a relative file (a partial name) the "current directory" gets involved.
This CD may get changed in many ways, e.g. by showing an OpenFileDialog,
SaveFileDialog, ...
It depends on their RestoreDirectory property (which modified the behavior the
second time you show such a dialog).
|
|
|
|
|
hi
in my windows based application i need to export data from grid to excel,word. iam very new to c#.net.please kindly help me.
|
|
|
|
|
hi,
you can use Excel API for that purpose.
Just include Microsoft Excel component in your project's reference and you will be able to use Application.Excel component.
Manoj
Never Gives up
|
|
|
|
|
Hy,
I have a problem with an Open File Dialog. When I press the browse button I open an Open File Dialog.I try to make a folder...an I can make it.And If I try to delete it my program crashing with message: Attempting managed execution inside OS Loader lock. Do not attempt to run managed code inside a DllMain or image initialization function since doing so can cause the application to hang.
Can someone to help me with some idea?
Can I put a restriction to only selection without changes in my Open File Dialog?
10x
|
|
|
|
|
I added elements to hashtable but they are not in the order in which i added. The code is below:
Hashtable table = new Hashtable(4);
table[new Regex(@"^(-?)(\d*?)\.?(\d{0,1})?$")] = "$1$2.$3";
table[new Regex(@"^(\d*?)\.?(\d{0,1})?(-?)$")] = "$3$1.$2";
table[new Regex(@"^(-?)(\d{1,3}?)((?:,\d{3})*)\.?(\d{0,1})?$")] = "$1$2$3.$4";
table[new Regex(@"^(\d{1,3}?)((?:,\d{3})*)\.?(\d{0,1})?(-?)$")] = "$4$1$2.$3";
I want these elements in the same order. Some times it takes the same order and some times it does not. I know hashtable does not take elements in same order.
But is there a way for this?
|
|
|
|
|