|
First, I have ComVisible set to true for the entire assembly.
I have (abstract) base class A. There are interfaces IA and IAEvents for accessing properties of this object and exposing events.
[ClassInterface(ClassInterfaceType.None), ComSourceInterfaces(typeof(IAEvents))]
public abstract class A : IA
{
...
}
I then have a derived class B and an interface IB (IB also derives from IA).
public class B : A, IB
{
...
}
Given an instantiation of B, I can access (from COM) properties/methods defined in either IA or IB.
However, when I then add a IBEvents (deriving from IAEvents) and change class B to:
[ClassInterface(ClassInterfaceType.None), ComSourceInterfaces(typeof(IBEvents))]
public class B : A, IB
{
...
}
I can no longer access methods/properties defined from A/IA. Only those defined at the B level. Commenting out the attributes on B will make it work, but of course the new events from IBEvents do not exist. Is there some wierd trick with regards to inheritance and COM that is preventing this? Is it still possible to do what I want? I intend to have a great many classes deriving from A each with their own unique set of properties and events in addition to the 'base' ones defined in A.
Ideas?
Adam Clauss
|
|
|
|
|
Hi,
I made a few textboxes where a user would put data in.
If the first box has data entered, it should enable the next textbox.
The problem is, what can i do if the user presses a few times the spacebar.
Because the next textbox will be enabled.
Thanks in advance!
|
|
|
|
|
You can trim the Text property just like you would trim a string (thats just what the Text property is).
I am not sure if that was your problem, though. It reads like you are referring to setting input focus to the next textbox? Please clarify.
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
Hi Sebastian,
Maybe you understand the code better than my words
private void Textbox1_TextChanged(object sender, EventArgs e)
{
this.Textbox1.Text.Trim();
if (this.TBLicensePlateCar.Text == string.Empty)
{
MessageBox.Show("Nothing is typed", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
this.data = this.Textbox1.Text;
this.NextTextBox.Enabled = true;
}
}
One char is enough to enable the next textbox. But is shouldn't be a space.
|
|
|
|
|
Yustme wrote: this.Textbox1.Text.Trim();
This line returns a new string, so you must assign it to something otherwise the trimmed copy of the string is lost. Probably what you wanted was
this.Textbox1.Text = this.Textbox1.Text.Trim();
|
|
|
|
|
Hi J4amieC,
That worked! Thanks.
I do get the messageBox twice now. Wonder how this keeps happening...
|
|
|
|
|
My guess: The text-changed event fired again.
Scenario:
User enters a "space" in the first textbox. The text-changed event fires.
The method gets called. The string is trimmed (now empty) and stored in the Text-Property. The new text (empty) is different from the old text (space) so the text-changed event fires AGAIN.
Completion of the first call occurs (MessageBox and all).
The method gets called again for the second text-changed event. This time, trimming yields the same string as before, so no change occurs.
Completion of the second call occurs (MessageBox and all).
You could either remove the handling from the text-changed-event during the trim (not sure if that works) or you could actually compare the new string to the old one and return immediately if they match.
And I am sure there is a better way
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
Hi Sebastian,
You're right.
Im trying a few things right now.
|
|
|
|
|
Hi,
I'm testing a piece of hardware that receives network traffic and want to see exactly at what frequency it gets overburdened by the load of traffic. To do this I wrote a simple program that sends packets at a set interval.
My problem is the following: The hardware doesn't break up at intervals of 1 millisecconds, so I need higher resolution delays or timers in my program (somewhere in the order of 50 microsecconds or so) than the timers I've been using (Threading.Timer or Forms.Timer). I found an article on the net saying this is possible with C++, but I can't find any info on the subject in c#. Can anyone help?
Thanks in advance for any help I might get...
|
|
|
|
|
Did you take a look at this[^] article?
|
|
|
|
|
A bit late, but just wanna thank you for the tip, this works excellent!
|
|
|
|
|
Hi Gurus,
I'm using the PropertyGrid control, and I want it to show a button.
But when I set the PropertyGrid.SelectedObject with a object that has a Button property, the PropertyGrid shows the buttons properties, and I want the button to be shown as drawn and clickable button without any access to its properties.
How can I do that?
-----
Thanks
Sharon
|
|
|
|
|
I have download (Sent Meassage) from code project it is running well as well as when we enter correct details in the textboxes then it donot send SMS on Mobile Phone it only it send mail on the email address which is fill by us at the time of send sms the error are below
Subject: Delivery Status Notification (Delay)
This is an automatically generated Delivery Status Notification.
THIS IS A WARNING MESSAGE ONLY.
YOU DO NOT NEED TO RESEND YOUR MESSAGE.
Delivery to the following recipients has been delayed.
919810099974@airtelmail.com
Message/delivery-status
Reporting-MTA
it is show error on every mobile phone
if you have any suggestion then send us on below address
Manish Kumar
manishgkumar@yahoo.co.in
Manish
|
|
|
|
|
Hi All Prespected Programmers
Kindly send me method that, How may I add Integer values into Combobox Itemdata and How may retreive Integer values from Combobox Itemdata?
Thank you in Advance
|
|
|
|
|
There are three file Default.aspx, Default1.aspx and Default2.aspx.. Is it possible to call remaining two pages if I click on a Button in the Default3.aspx .? The pages are individual.. If i click on a button in Default3.aspx the page_Load Event of the remaining two pages has to be called/processed... I am using ASP.NET 2.0 and C#. pls give me suggestion. If you send code its great.
Thanks
Hosanna.
|
|
|
|
|
Sounds like your overall design is horribly wrong.
If you have code that every page should process, put it in a base class. If it's related to business logic, put it in your middle tier ( and perhaps call it from there in a base class ).
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
There are three file Default.aspx, Default1.aspx and Default2.aspx.. Is it possible to call remaining two pages if I click on a Button in the Default3.aspx .? The pages are individual.. If i click on a button in Default3.aspx the page_Load Event of the remaining two pages has to be called/processed... I am using ASP.NET 2.0 and C#. pls give me suggestion. If you send code its great.
Thanks,
Hosanna
|
|
|
|
|
Simply restateing your question does not help anyone answer you more fully than Christian already has!
|
|
|
|
|
Seriously, I answered you, your page design is completely broken. You cannot do this, you need instead to write your pages properly.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
lo,
i want to change a number in a certain cell
i thought i coud change it with a for loop
and i found that i can select a cell with datagridview[columnindex,rowindex]
so i thought that this would work:
datagridview[3,2].value=x.tostring(); //x is a int from the for loop
but it doesnt,
anybody ideess ???
plzzzz
|
|
|
|
|
YOU CAN USE SIMPLY
IT WILL CHANGE THE DESIRED VALUE WITH YOU VALUE
DATAGRID[ROW,COLUM]="YOUR TEXT";
sikandar
|
|
|
|
|
when i write
datagridview2[3,2]= "this is text";
i get an error
Cannot implicitly convert type 'string' to 'System.Windows.Forms.DataGridViewCell'
|
|
|
|
|
datagridview2.Rows[3].Cells[2].Value.ToString()= "this is text";
|
|
|
|
|
it works :p first not but now it does
thxx
|
|
|
|
|
Never mind dude
|
|
|
|