|
Thanks for the response... i think ill adopt that method in my client/server application...Thanks again!
|
|
|
|
|
Anyone knows how to get a video frame from the video object mentioned in the title ?
thanks
|
|
|
|
|
How can I overload a constructor elegantly where the body of the multiple cnstr's holds the same code. For instance:
public C( string s, double p )
{
local_s = s;
local_p = p;
}
pubilc C( double p )
{
local_p = p;
}
I'd like something such as:
public C( string S, double p )
{
local_s = s;
C( p );
}
but the compiler complains 'C' denotes a 'class' which is not valid in the given context. Of course I could write a private function call to load 'p':
public C( string s, double p )
{
local_s = s;
save( p );
}
public C( double p )
{
save( p );
}
private save( double p )
{
local_p = p;
}
but this seems inelegant.
Please advise. Thx.
|
|
|
|
|
Try :
public C( double p )
{
local_p = p;
}
public C( string S, double p ) : this( p )
{
local_s = s;
}
----------------------------
Be excellent to each other
|
|
|
|
|
Interesting, I've not seen this syntax before.
I understand the class declaration
public class C : A {
// foo
}
but ':' in a constructor? Would you pls elaborate a bit?
Thx.
|
|
|
|
|
As part of the constructor declaration you can call a base constructor or another constructor in the same class. This is very convenient for constructor overloading:
class MyClass : AnotherClass {<br />
<br />
private int b;<br />
<br />
public MyClass(int a, int b) : base(a) {<br />
this.b = b;<br />
}<br />
<br />
public MyClass(int a) : this(a, 42) {}<br />
<br />
public MyClass(bool a) : this(a?1:0) {}<br />
<br />
}
---
b { font-weight: normal; }
|
|
|
|
|
|
i want using this code
public Form1()<br />
{<br />
InitializeComponent();<br />
Thread thrd = new Thread( ThreadStart(this.MyMethode()));<br />
thrd.Start();<br />
}<br />
private void MyMethode()<br />
{<br />
label1.Text = DateTime.Now.ToString();<br />
Thread.Sleep(1000);<br />
}
but this error occurs
D:\Help Documents\C# Projects\Threading(WinApp)\Form1.cs(23): 'System.Threading.ThreadStart' denotes a 'class' which is not valid in the given context
what is problem?
---------------------
Areff Bahrami(KAVEH)
Areff.HB@Gmail.com
---------------------
|
|
|
|
|
Try:
Thread thrd = new Thread( new ThreadStart(this.MyMethode));
----------------------------
Be excellent to each other
|
|
|
|
|
Answer from Nicholas is very good, but your code will also generate a run-time exception when executing the label1.Text = .... from the other thread, because the control was initialized in another thread.
Change to something like:
class Form1
{
private delegate void SetLabel1TextDel();
public Form1()
{
InitializeComponent();
Thread thrd = new Thread( ThreadStart(this.MyMethode()));
thrd.Start();
}
private void MyMethode()
{
if (this.InvokeRequired)
{
this.Invoke(new SetLabel1TextDel(this.SetLabel1Text));
}
else
{
this.SetLabel1Text();
}
Thread.Sleep(1000);
}
private void SetLabel1Text()
{
label1.Text = DateTime.Now.ToString();
}
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
Thank you Nicholas and Michel
---------------------
Areff Bahrami(KAVEH)
Areff.HB@Gmail.com
---------------------
|
|
|
|
|
hi
i want to begin 3d programming with OpenGL and i am professional 3dsmax user.
how to begining openGL programming in c# ?
please give me an article with example because i am very beginner for 3d programming.
and what is needed for opengl programming ? (please give me url for download OpenGL SDK)
thanks..
|
|
|
|
|
Is there a way to code a ContextMenu so it looks like the Windows Start menu?
OK first how do you assign image to a item in menu so you see the icon and then text?
In the end we're all just the same
|
|
|
|
|
I am going to write an application to read a video file (mpeg4)...then do some object tracking...so i need to grab individual frames...scan the pixels..etc etc....
Any idea if C# is suitable for such an application ? If yes..any help is more than welcomed !
Thanks
|
|
|
|
|
Hi
I develop a mobile device with a Touch-Screen (1024*768) with XP-Embedded. The application should be region/language independet.
The standard XP On-Screen-Keyboard is too small.
Can I manipulate the size of the buttons programmatically?
or
Is there a way to program a multi-language keyboard myself?
or
Does anybody know a good 3rd-Party-Tool/Library programmed in C#?
Thanks and best regards,
Martin
|
|
|
|
|
i have two combo box on my page. depending on first combo box value of second combo is changed. in second combobox i have some data which is not visible completely becoz the length of data is bigger than size of combobox.i don'nt want to change the size of combo box
my problem is when the size of data is bigger than the size of combobox . when i keep the the mouse pointer on that data the data scroll to left and right so that visible properly without changing the size of combo box
Amit Grover
CDAC R&D
|
|
|
|
|
hi guys,
I'm using the standard toolbar (.NET) and I need to set the background colour. Unfortunately I could not find a way.
Any pointers pls?
programming....the devine gift from God
|
|
|
|
|
hi friends
i am trying to fetch data from Oracle database using dataadpator into data table.But i am not able to get it.
I am using the OracleClient namespace. Data is getting inserted in the tables but not able to fetch from there.
If someone can providethecode for itthen it'll be really very helpfull. the program is not giving any errors. the same codewhen used with SqlClient namespace fro fetching data from sql server, then it was working properly.
Kindly someone please give me some urgent help regarding the above mentioned problem. if you want the code for it then do ask me i'll provide it.
Thanx in advance.
nauty
|
|
|
|
|
Hi all ,
I am using a qodbc data source. when i fire a select query on a table i get following error
"QODBC ERROR [42500] [QODBC] Error"
Can any one help me?
|
|
|
|
|
i need a function that:
when i enter a date , function checks that format
if that format is correct(such as 1384/02/03) return 1 and if not correct return 0;
and type of date field in database is not "date" its "varchar".
and my date is solar it's not of the Christian era.
thanks for your help
|
|
|
|
|
Don't spam the forum.
Don't cross post.
|
|
|
|
|
|
WHat would the coding be to open an XML file when the application loads?
its saved in the applications folder under Settings\\Settings.xml
In the end we're all just the same
|
|
|
|
|
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load("FILENAME.XML");
|
|
|
|
|
Thanks!
In the end we're all just the same
|
|
|
|