Pubsnack's Q&A profile
Visual C# C# - Generics on this class type
Hello, I am trying to instantiate a generic class, using the current class as a parameter. Normally you would do this like this (assuming a class MyClass): private Generic<MyClass> _g = new Generic<MyClass>(); And then i wrap this instance in a read-only property called MyGeneric: public MyGeneric<MyClass> MyGeneric { get { return _g; } } However, this is not really object oriented. Since any class derived from MyClass (MyDerivedClass) would have an instance typed on MyClass, not MyDerivedClass. i.e: MyDerivedClass.MyGeneric returns a Generic<MyClass>. So, how can i instantiate a Generic class using the current class-type as a parameter, in a truly object oriented (polymorphic) m ...Show All
Windows Forms How do I disable the AddNewItem button on the bindingNavigator control ?
I have a simple form with a DataGridView, a BindingNavigator and BindingSource allowing me to view the contents of a table called 'RUN'. I have included the DataSource in my project so a runTableAdapter and myDataSet.Run has been created automatically for me. The problem is that on this particular form I don't want the user to be able to add new items using the BindingNavigator control. I could just delete the 'AddNewItem' control from the navigator but for a consistent look and feel I would rather just disable it. I can disable it at design time which works to begin with. Then at run time, the user can select some 'filtering criteria' using other controls on the form and then press a button. I then fill the table using the following: ...Show All
Visual Studio Team System Visio for enterprise architects freezes on database stencil selection
Hi! I've installed Visio for enterprise architects on a windows xp x64 machine running visual studio 2005 team system for software developers, applied all the available windows updates and, as soon as i started visio and selected a database stencil, i got a freeze... I uninstalled and reinstaled visio... with no luck I downloaded SP2 for visio2003 but i couldnt install it since my version is visio 2003 EA... I've searched online for an answer with no luck It only freezes when a database stencil is selected... other stencils work fine! I tried to force visio to close but it didnt responded so the system auto-killed the process... and sent a bug report to microsoft... and by the look of it i was not the first person with this problem... Is ...Show All
Visual Basic Combo Box & Tab control focus() question
how can i limit the user to selecting only items in the combo box and not be able to type in it How can i send focus to tab control, and also specific controls masked text box for the masked text box how can i disable the lines indicating the mask so that it looks like a normal text box can i force the typing in the masked text box to be from the left so that the user can't type starting from the middle for example. can i dynamically add tabs, like in IE7, tab browsing lastly, can i layout my program, so that the user can choose between opening in tabs or new windows Thank you but how can i design the layout so that i don't open a blank page also how do i force the input to be from lef ...Show All
Internet Explorer Development Moving TextBox input to ListBox using Javascript
Here is what I tried but it isn't working, can anyone and have a look what I am getting wrong: My goal: To get input from a TextBox to ListBox Javascript file: function MoveItem() { var Source = document.getElementById('TextBox1').value; var Target = document.getElementById('ListBox1'); if (Source != null) { var newOption = new Option(); // Create a new instance of ListItem newOption.text = Source; newOption.value = Source ; Target.options[Target.length] = newOption; //Append the item in Target //Source.remove(Source.options.selectedIndex); //Remove the item from Source } } code-behid file: partial class _Default : System.Web.UI. Page { protected v ...Show All
Smart Device Development Symbol MC70XX series physical assigned button
Hi, I am working on Symbol MC70XX device. I assigned buttons from Start_Settings_Buttons to some programs but I can not find the right physical keys for these assigned keys to start the assigned programs. For example for Button 1, what key do I press on the device to start the assigned program Any advice would be appreciated. Thanks Bahman I found 193,194,195,196 for these codes (xx) and changed GreenKeyOverride in the registry, but nothing happened. Anybody knows what is wrong Please. ...Show All
SQL Server DBMail - Attach CSV File - CSV file format NOT recognized when Excel tries to open it
Afternoon. OK ... I have DBMail generating a CSV file from a query. ALL WORKS GREAT! I get the email and attachment. Issue is when I try to open the CSV, Excel comes back saying it does not recognize the file format. If I continue to open it, all of the column headers are in one cell as well as all the fields generated by the query are in the same row(s). I even see the comma "," seperater inbetween each column so I know the delimiter is being placed correctly. I am also able to save the attachment as a TXT file and then I am able to import it as a comma delimited file and it brings it in just fine. SO ... how do I correct the issue of the CSV not being in a format that Excel can open by default Thanks ALL! ...Show All
Visual Basic Clock formatting
I wrote a countdown timer program, but it seems that the clock does not show the 0 when it is less than 10, specially in the minutes and seconds. In the hour part, it's probably alright, but I'd like to show 0 in the minutes and second display. I use String .Format with this kind of formatting: "{0:d}:{1:d}:{2:d}" How do I show the zeroes in front You can use the .PadLeft method, or, for dates use the following formatting: Dim d As Date = Now Debug.WriteLine( String .Format( "{0:HH}:{0:mm}:{0:ss}" , d)) ...Show All
Visual Studio 2008 (Pre-release) Unable to install Visual Studio Extension "Orcas" to MS.NET Framework 3.0 July CTP
Hi, I am trying to install the July CTP and here are the steps i followed... - Microsoft .NET Framework 3.0 July CTP - Microsft Windows SDK July CTP - Visual Studio Extension Windows Workflow RC4 - Visual Studio Extension "Orcas" and i am getting an error message saying the Microsoft .NET Framework 3.0 runtime and components are missing when i tried to install the Visual Studio Extension "Orcas". Anyone has met with this problem >> Reborne. There is no July CTP of the Visual Studio Extensions. You will need to install the June CTP version of the is extension, but you need to use a particular command line. Check this post to understand exactl ...Show All
Visual Studio 2008 (Pre-release) Impersonation problem?
Hi, I seem to have discovered some rather strange behaviour inside a service when trying to impersonate the caller. I'm using WsHttp binding with default settings - no additional BindingConfiguration specified. My client side proxy is generated using the 'Add Service Reference' function from Visual Studio. The problem arises when the clientside proxy has its AllowedImpersonation property incorrectly set to the default 'Identify value', as in proxy.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal. TokenImpersonationLevel .Identification; On the server side, I'd expect the WindowsImpersonationContext impersonation = ServiceSecurityContext .Current.WindowsIdentity.Impersonate(); call ...Show All
Windows Forms How to cancel the process untill the validations conditions are met when click the button? --VB.net or VS 2005
Hi I have a 10 tabs in windows form (VB.net or VS 2005). I have validation function to validate the textbox control in the tabpage. So if the condition not met the validation triggers when leave the tabpage and inform the user by message box. When user responds to that message box the curser move on to other page or other control. But I want keep user to stay on that tabpage untill the validation conditions are met. The sample code will be appriciated. Advance thanks Hi Thanks for your help. I have one more question: I have 10 tab pages. Assume that I have put all validation functions in the "Button click"(Save button) .When button click IF any conditions NOT met in tabpage1 and if the user is in any ot ...Show All
Windows Forms Transparent label Control in VB 2005
I am trying VB 2005. The label control has no transparent (backstyle) option. The help says that this is so and to overcome it by setting the background color to transparent. I tried this but still get error that backcolor transparent is not supported. This is very annoying as I use transparent labels and text boxes all the time. Can anyone tell me what I am doing wrong or an alternative. Alot of the controls/components in Windows XP were released unfinished. Which may explain why alot of properties for certain controls/components act in awkard manners such as this. ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Bug in BoundingFrustum.Contains()?
If i write the following code: BoundingFrustum f = new BoundingFrustum(new Matrix(1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 2)); Vector3 vector = new Vector3(1,1,1); BoundingBox box = new BoundingBox(vector, vector); ContainmenType t; t = f.Contains(vector); Console.WriteLine(t); t = f.Contains(box); Console.WriteLine(t); I'd expect both to give the same answer. Either both are contained or both are disjoint. However the Frustum contains the point but the box is disjoint. What's going on It's not enough to test whether there is a single plane that excludes all the vertices. A box that's tilted just outside the corner of a frustum will then be considered "inside" even when it's "outside.&q ...Show All
Visual Studio Seeking request management software!!
Hi All I have been trying to streamline my program change requests into a central repository so that I can track/manage them in a better way. Any helpdesk solution might work but is there something which can integrate with SourceSafe and is provided by Microsoft ...Show All
SQL Server Merge: Records associated by a JOIN Filter not being sent to a subscriber
Hi, I have a merge (SQL 2005 Standard -> Express) topolgoy which is having problems The main problem is that the join filters don't seem to work for one area and I am hoping someone can help me with some troubleshooting advice There are 140+ tables in the topology but the ones causing particular pain are a parent child relationship where the child is actually a bridge/linking table to another table. Therefore although it is a parent child in the replication filters it is the reverse. i.e. the child has the paramterised filter on it and the parent is one level down joined by it's id. There are other tables joined to this parent table but it stays at three levels deep. The @join_unique_k ...Show All
