|
hi
I have an event defined in a base class. I'd like to raise this directly from a derived class, but the compiler won't let me do this, so instead I created a method RaiseMyEvent(...) to raise the event in the base class. Can I raise the event a simpler way? (otherwise I'd need to create a RaiseEventX function for each event..)
thanks!
|
|
|
|
|
No you can't.
There is a really good article on events here
[^].
|
|
|
|
|
when we create application form in visual c# in solution tab there is some think name refrence what is this plz any tell me in detail
wasim khan
|
|
|
|
|
If you define a reference to another assembly in a project, you can call code in that assembly from the project.
BTW, this is a pretty basic question. You should really read a beginner's book on C#.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
pmarfleet wrote: You should really read a beginner's book on C#.
I believe so.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Hi...I am trying to detect connection of a device with system using com port...i want to show a message box when a device is plugged in and plugged out.....How can i do it?
Vishal
|
|
|
|
|
Hi,
there basically are two approaches, both requiring some cooperation from the device:
1.
by hardware signaling:
if your device is pulling one of the control pins, you can detect that by looking at
some SerialPort properties (CtsHolding, CdHolding, ...) or wiring its PinChanged event.
Of course that would not tell you for sure which device is attached.
2.
by software polling:
the device might periodically send some data, which you could read (possibly thru the
DataReceived event); or you could periodically ask it to send something (timer+Write+Read).
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Thanks a lot buddy....i am sure now that i can implement it..
|
|
|
|
|
I am developing an application in which i need to increase decrease size of form on timer tick.
Means for a the height of the form will increase upto defined size and after getting to that certain point of height the size of the form will start decreasing to the defined point.
|
|
|
|
|
Well, you can change the form size using the Width and Height properties. Then you can just increase those until you get to the size you want, then start decreasing them, here let me give you an example:
int Difference = 5;
int MaxWidth, MinWidth, MaxHeight, MinHeight;
timerTick()
{
this.Width += Difference;
if(this.Width >= MaxWidth) {
this.Width = MaxWidth;
Difference *= -1;
} else if(this.Width <= MinWidth) {
this.Width = MinWidth
Difference *= -1;
}
}
My current favourite word is: PIE!
I have changed my name to my regular internet alias. But don't let the 'Genius' part fool you, you don't know what 'SK' stands for.
-The Undefeated
|
|
|
|
|
Hi!
I want to change the color of a particular charecter in a textbox how it is possible...
|
|
|
|
|
vijayashanthi wrote: I want to change the color of a particular charecter in a textbox how it is possible...
I don't think you can. You should use the RichTextBox[^] control instead.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
now a days i m learning c# can any body tell me about the assembly why we need them and where we use it in development
wasim khan
|
|
|
|
|
An assembly is a dll or an exe.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
An assembly is the smallest unit of distribution of compiled code. It can consist of a (or more) dll, an exe. However there is much more to it. Assemblies are self describing, they contain an identity (version, culture, etc).
Read it more on here[^].
You should really start using Google for these questions!
|
|
|
|
|
Hi All,
See the below lines of code.
StreamReader objReader = new StreamReader("c:\\test.txt"); <br />
string sLine = "";<br />
ArrayList arrText = new ArrayList();<br />
while (sLine != null)<br />
{<br />
sLine = objReader.ReadLine();<br />
if (sLine != null)<br />
arrText.Add(sLine);<br />
}<br />
objReader.Close();<br />
foreach (string sOutput in arrText)<br />
MessageBox.Show(sOutput);
In the above sample, am reading a text file and populating the array list. In this case, the output shall be
each location of the array contain the entire line of string
But, i want to get each item (string) of the single line of file into a seperate location of the array. Can anyone help?
Is there any way to read a csv formatted file ?
|
|
|
|
|
Is this .NET 1.1 or 1.0 ? I assume so by the use of arraylist. If not, you can use File.ReadAllLines to do this in one line of code. Then you can foreach to show them if you want.
TechBrain wrote: But, i want to get each item (string) of the single line of file into a seperate location of the array.
Oh, I see what you want. The split method of the string class can turn a comma seperated string into a string array representing your individual items.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Yes, there's at least one article on here about reading CSV files.
Otherwise Split the line on commas and store each resultant string array.
There are many ways to skin this cat.
|
|
|
|
|
hi.. i used expression blend to develop my project design.. so when i open the .xaml.cs to write the code.. i fail to connect to database..
before using blend.. i used to use the Visual studio's data binding wizards to connect to the database.. e.g. using databinding.. dataadapter in VS 'toolbox..
but when i use up the blend..i open the design .xaml.cs... to get to those dataadapter function in vs toolbox.. I FOUND NONE !!! why??
if like this how to create datbase?
|
|
|
|
|
eg. i created a textbox in blend.. then open .xaml.cs and then click on the design view .xaml ..
i add the database on the .xaml through add existing item.. added data source.. BUT I AM UNABLE TO BIND WITH THE TEXTBOX .. no wizards in the toolbox provide me that function ..
only i write in coding enables me to access to database? no wizards?
|
|
|
|
|
Hi all'
I have added a New item (class named class1.cs) with the same namespace.when I used the code below
"class1 s=new class1()"
the object can't be created
ERROR:error(class1.cs is inaccessible due to protection level)
reply me HURRY!.
Regards,
chanzeb chaudhary.
|
|
|
|
|
Please paste the class1 code...
Regards
Pankaj Joshi
If you want to shape your dreams into reality, please wake-up...
|
|
|
|
|
using System;
using System.Collections.Generic;
using System.Text;
namespace Filing
{
partial class fetchSchema
{
fetchSchema()
{
}
}
}
Regards,
chanzeb chaudhary.
|
|
|
|
|
The class needs to be public I reckon.
public partial class fetchSchema
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Instead of partial class fetchSchema
public class fetchSchema
Regards
Pankaj Joshi
If you want to shape your dreams into reality, please wake-up...
|
|
|
|