|
Its always np to help you, not saying your questions are always simple, but you ask them correctly, use PRE tags and don't type like a 13 year old. Refreshing to see
He who makes a beast out of himself gets rid of the pain of being a man
|
|
|
|
|
Phannon wrote: you ask them correctly
yeah, took the time to read the rules may that be a lesson for the rest of yall
Phannon wrote: don't type like a 13 year old
mayb cuz im a 19 year old
thanx again for the help, i duno what id do without you guys at CP... fall WAY behind on my deadlines
im going home now, its 7pm here in South Africa and ive been at work since 6am
cheerZ
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
StatusStrip don't process mouse clicks if parent window is inactive.
I have an application with two winforms, one which has a StatusStrip object. The StatusStrip object has a couple of buttons with mouse click handlers hooked up.
If the window with the status strip is the active window, the mouse click handler get called when user clicks on a button on the status strip.
If the window with the status strip is not the active window, it takes two click on a status bar button to get the mouse click handler called. The first click only activates the window and do not result in a call to the click event handler.
Anyone knows how to fix this? How to get a status strip to fire events even if it is in a nonactive window so user don't have to click twice?
|
|
|
|
|
Hello, all you smart people.
Short version:
In Visual Studio 2005, the 'Data' menu item at the top of the screen keeps disappearing after I attempt to show the existing data sources, or add a new data source. Any ideas?
Long version:
I'm encountering a rather frustrating issue in Visual Studio 2005, SP1. I am creating a Visual C# ASP.NET Web application, and I want to add a Data Source to the project. Now, when I first create the application, the 'Data' menu is available at the top of the screen, with the two sub-menu items 'Show Data Sources' and 'Add New Data Source'. The respective icons also appear in the Data Design toolbar.
However, when I click the 'Show Data Sources' icon, or the 'Show Data Sources' menu item, the Data menu item disappears, and the Data Design toolbar icons become disabled. No matter what I try, I can't get the Data menu item to re-appear. If I completely shut down VS 2005, then launch it again, the Data menu is back. But the same behavior exists (i.e., it disappears if I try to use it). Similarly, if I click the 'Add New Data Source', I am allowed to go through the process of adding the data source. But when I am done with that process, the Data menu makes a hasty exit, and I can't even view the data source I allegedly created.
Any idea what is happening, here? As far as I know, my installation is fine. This does not appear to be the issue of the 'Data' menu disappearing when the context of programming calls for it to disappear (for example, when editing code).
My Google-Fu has failed me on this issue, so I am calling out the big guns (RE: this forum). Thank you in advance to any and all those who read this, and a special thank you to those who respond.
modified on Wednesday, March 19, 2008 12:33 PM
|
|
|
|
|
packmichael wrote: Visual Studio 2004
Must have missed that release.
only two letters away from being an asset
|
|
|
|
|
Ha ha. Sorry, make that Visual Studio 2005. I have changed the original post to avoid any future confusion.
|
|
|
|
|
how to disable arrow keys on grid to fire any event.
without inharit grid class.and override processcmdkey
event.
amit
|
|
|
|
|
|
Don't cross post it is an abuse of the sites resources. Also neither of the forums you posted this in is the correct one. Good luck
|
|
|
|
|
I have a windows app and on form_load i am calling a funciton that is building a list but this function gets called on other ocassions also (when there is change in data (i.e. add, update or delete)). I want to raise an event when I have the item.Name available so I can populate the drop down box with the item names.
So essentially I want an OnItemLoad event to be fired and when its fired I want the drop down box to populate the items.
for (int i = 0; i < Category.Length; i++)
{
#region This section needs to be replaced by the event
if (populateCategoryDropDownList)
{
ddlCategory.Items.Add(Category[i].CategoryName);
}
#endregion
...
txtControl.AutoCompleteCustomSource.Add(temp);
...
}
I have tried working with examples available on msdn etc but it gets soo confusing! this seem like a very simple task but I just can't seem to figure it out. Please help !
|
|
|
|
|
What is "item.Name"?
Do you need an event, or do you just need to call the method that builds your list from other events, like Load?
only two letters away from being an asset
|
|
|
|
|
Sorry, Item.Name = Category[i].CategoryName
Item being a drop down list item.
This can be done with a call to a method but there is some other stuff that can be accomplished once I have a specific category available. I tried to omit the details out to keep the question simple.
But for argument's sake, for each category there are several other child records that need to get processed. Some of them are shown on the UI and some of them are more like calculation type results.
I thought using event would simplify the process and would also increase the performance (not sure if this is true) by completing the task on a separate thread.
Thanks
|
|
|
|
|
Events are an implementation of the observer pattern. They are used to notify an interested party that something has happen to an object that they have expressed an interest in knowing about. Events don't increase performance, however, can certainly decrease it if not used properly. From what I can see from you description you don't need to use events.
You should also do more research before trying to use a technique you are unfamiliar with. Learn when and why to use, and when not to use it.
only two letters away from being an asset
|
|
|
|
|
Hi,
Can somebody tell me what are all the limitations of the constructor of a struct?
Is it possible to declare an ordinary writeline statement in its constructor?
Regards,
Lenus.
|
|
|
|
|
I am sure it is in the documentation of a struct what the limitations of a struct are.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
ok. Thnx. What abt the second question? Is it possible? I tried but it isn't working. I felt quite strange at this.
Regards,
Lenus.
|
|
|
|
|
To declare actually means to define which would mean object WriteLine; is a valid answer. I think the professor means, can you call System.Diagnostics.WriteLine; experimentation will yield the answer just make sure you are building in debug mode with a console application first.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
No I just want to print out something from the struct's constructor which is not happening. Why is it so?
Regards,
Lenus.
|
|
|
|
|
|
I tried. Its not possible from the constructor I create for a value type (declared without new keyword) struct.
Regards,
Lenus.
|
|
|
|
|
Limitation is that structs cannot contain explicit parameterless constructors. But you certainly can use Console.WriteLine in sturct's constructor. See this example:
using System;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Test t = new Test(7);
Console.ReadLine();
}
}
public struct Test
{
public Test(int x)
{
Console.WriteLine("I'm Test's constructor and this is my x parameter: "+ x.ToString());
}
}
}
|
|
|
|
|
Yes it is possible only if the struct is instantiated (as if it was an object). Not in the other case when we declare it without the new operator(as if it was a value type variable).
Any suggestions?
Regards,
Lenus.
|
|
|
|
|
It seems as if the constructors don't perform any other work than to assign fields withe values when created as a value type(without new operator).
Regards,
Lenus.
|
|
|
|
|
SPanicker* wrote: Not in the other case when we declare it without the new operator(as if it was a value type variable).
Now I know what you were asking, it was not clear from your initial post. In that case, default parameterless constructor is called and as I said before you cannot declare or override paremeterless constructor.
|
|
|
|
|
Even in this case, the constructor(which i provide) is getting read and the values are assigned.
Only exception is that,I cannot call any other functions from inside that( But values can be assigned to variables ).
I still need two points to be cleared:
As you said if the parameterless constructor cannot be overridden then how is this happening?
If the parameterless constructor cannot be overriden, then why is C# designed to accept such constructors which are of no use?
Thanks.
Regards,
Lenus.
|
|
|
|