Tharindu Dhaneenja's Q&A profile
Windows Forms Control deep inside(mouse activate control on usercontrol)
Hi to everyone. I have complex gui structure that is I have UserControl(say CoolEdit) that contains another UserControl and 2 buttons. Second UC in its turn contains WebBrowser. The problem is that i need CoolEdit to stay focused wherever user clicks on it and whichever keyboard button pressed. I managed to achieve this only partially. First I override IsInputKey & ProcessDialogKey to prevent container to process navigation keys. Second to prevent buttons( 2 buttons on CoolEdit) to receive focus i used SetStyle (Selectable, false) and also focus CoolEdit when button clicked. But i have problem with second UC that hosts webbrowser - it receives focus when it is clicked. I tried to process WM_MOUSEACTIVATE in webbrowser but it works c ...Show All
Windows Forms Handle a textbox outside the form
Hi all, I'm new in C# and I'm still learning basic function. I'm sure this one is very simple but I can't find any help. I want to change the value of a textbox from a public class that is outside the form that contains the textbox. So, I cannot use this.textbox.text = ... I try to declare the textbox as a static variable like static System .Windows.Forms.Control Status = System .Windows .Forms .Form.ActiveForm.Controls[12]; but it is not working, Anybody has a idea Thanks in advance! Bertrand Hi Bertrand, You have two possibilities: - declare your TextBox as public . Then you can call the TextBox like this: ParentForm.TextBoxName.Text = ... - You can also create a property on your form t ...Show All
Windows Forms help in windows service
hi , here is a little problem i am facing and it is urgent please help me , i have a windows service that updates records in a database , that database is also used by a gui application now , the path of the database is relative to my installation of windows service application in an app.config file it is something like this : <add name="projectConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=database\project.mdb" providerName="System.Data.OleDb" /> </connectionStrings> now when i install the service it looks for the database in system32 folder and does not get the database since a windows service runs under system32 folder it looks for the database ...Show All
Visual Studio Team System postbuild event
Hi, Would it be possible to add a postbuild event feature to the database project I have a scenario where I would like to run aspnet_regsql.exe utility to install/merge the ASP.NET 2.0 services database into the database that I am building with VSTS-DB. I basically want to avoid creating the ASP.NET services db schema by hand (or even importing .sql files) -- I'd rather run their tool and point it at the database created by the build. The postbuild event could provide some macros (e.g. Target database name, connection string, etc) that I can then use as command-line switches to aspnet_reqsql.exe. Thanks, Vitaly Just to let you know, we implemented pre and post build events just like you have i ...Show All
SQL Server Conditional Send Mail Task
Hi, I want send email if certain conditions are met (by send mail task)... if compnay records does not exists in some table (returns null)... not task failure.... how do I achieve this without using Script task does any one have an idea about it, regards In contiuation i would like to ask another question i.e. I want to send the results of my query (complete result sets) from email task How will I able to achieve the task. ur help will be appreciated ...Show All
Visual Basic .NET Runtime error when creating/opening a Web Application Project (VB only)
Hello, I'm encountering a strange .NET runtime error whenever I try to create or open a VB Web Application project using Visual Studio 2005. VS2005 simply crashes, but the Event Log shows the following error: .NETRuntime version 2.0.50727.42 - Fatal Execution Error (7A05E2B3)(80131506) This only happens when creating/opening a VB Web Application project. I can create/open a C# Web Application project with no problem. I've tried several things, i.e. re-installing the Web Application Project .msi file, its associated VS80-KB915364-X86-ENU.exe patch, repairing the .NET 2.0 Framework, and and have even re-installed VS2005. All to no avail. Have others seen this issue Any idea how to fix it Thanks, Michael ...Show All
Visual Studio 2008 (Pre-release) Access navigation Window elements
I have a navigation window defined in the app and the Source property is set to a XAML file. < NavigationWindow x:Class = " Mynamespace.MainNavigationWindow " xmlns = " http://schemas.microsoft.com/winfx/2006/xaml/presentation " xmlns:x = " http://schemas.microsoft.com/winfx/2006/xaml " Name = " NavigationBar " Source = " Page1.xaml " > I have defined some text blocks in the Navigation Window’s content presenter like this < ControlTemplate > < TextBlock TextDecorations = " None " > < TextBlock x:Name = " Link1 " > < Hyperlink > My ...Show All
.NET Development An existing connection was forcibly closed by the remote host, ConnectionReset Error
Hi, I am implementing an UDP client using asynchron methods. While implementation, I have realized an interesting error. I have tested the client without there is no server in connect. When client want to send an information to server, client get the error in receive callback not after send command. My Code is: private void Form1_Load( object sender, EventArgs e) { data = new byte [3000]; socket = new Socket ( AddressFamily .InterNetwork, SocketType .Dgram, ProtocolType .Udp); IPEndPoint localPoint = new IPEndPoint ( IPAddress .Parse( "127.0.0.1" ), 19250); socket.Bind(localPoint); socket.BeginReceive(data, 0, data.Length, SocketFlags .None, new AsyncCallback (OnReceive ...Show All
Windows Forms Populating a ListView with Object data, then populating the same object type with the selected ListView Item.
Hi all, I have an object that has many properties where I need to represent these objects (and their relating information) in a ListView Control, and when I select an Item from the ListView Control I would like to get the propeties of this object. Whats the best way to go about doing this Is it: if I have my AnswerSet object, extract the propeties of the object and assign each one to a SubItem of a ListView Item, and then when this ListView item is selected, create a new object and repopulate it with the data from the ListView sub-items This seems very cumbersome. Is there a smarter way of doing this Thanks in advance. Tryst Store your entire object in the ListViewItem object's Tag property and retrieve it when ever you need. This i ...Show All
Windows Forms DataGridView in VS 2005
Hi everybody, I have Website Addresses in a column of one of my DataGridViews. I would like to show it in HyperLink, so user can just click on it and go to the browser and view the Website. Does anybody have any idea !!! Thanks so much, Mathew I would use a datagridviewLinkColumn to show the url. In the cellclick event I would use process.start to open the website. Private Sub Form1_Load( ByVal sender As System. Object , ByVal e As System.EventArgs) Handles MyBase .Load Dim hl As New DataGridViewLinkColumn With hl .Width = 150 .HeaderText = "Link" End With DataGridView1.Columns.Add(hl) DataGridView1.Rows.Add( New Object () {" ...Show All
Game Technologies: DirectX, XNA, XACT, etc. XNA - Microsoft lack of vision
Its real sad that Microsoft, once again, shows this lack of vision for a games development tool: 1: Get visual: Don't force users to write such a lot of code to do just very little. It reminds the Charles Petzold's "Hello Window" hell of code days. 2: Provide visual tools: Let users choose the components, change their properties and write just the required code for the events. 3: Quick development means quick prototype and minimum learning curve. XNA has a lot of things to learn. Definetively it is NOT for students and hobbists. We will have to wait until someone encapsulates XNA framework into a group of visual components, that can be easily drag & dropped, inspected and tested very easily without having to learn lots of n ...Show All
SQL Server Stored Proc for creating and inserting into a table
I am having some trouble populating a table with values from other tables: I am creating the stored proc as follows: CREATE PROCEDURE make_temp_stat (@from datetime, @to datetime) AS DROP TABLE tempTable Create tempTable ( NumApplications (int), NumStudents (int), NumTeachers (int) ) //Then I insert the values into the table as follows INSERT INTO tempTable (NumApplications) SELECT Count(*) FROM [dbo].[CASE_APPLICATION] WHERE (OPEN_DT>= @from AND OPEN_DT <= @to) INSERT INTO tempTable (NumStudents) SELECT Count(*) FROM [dbo].[CASE_STUDENTS] WHERE (APP_DT>= @from_dt AND APP_DT<= @to_dt) INSERT INTO tempTable (NumTeachers) SELECT Count(*) FROM [dbo].[CASE_TEACHER] WHERE (JOIN_DT>=@fro ...Show All
SQL Server SQL Server 2005 System Table (View?) Map
Is there an estimate on the availability of the System Map for SQL2005 If it is already out there, would someone be so kind as to tell me how to get it Thanks, DO I am also after a Printed hardCopy of the SQL Server 2005 system catalog map. I can see the softcopy, but to relate the things together, its often not so comfortable to scroll the window up & down to see the complete view. ...Show All
Windows Forms list box Items
can anyone help me out... I've already populated a listbox with the ID: listItems... now I want to reorder the items... by having two buttons.. up and down buttons.... but once Ive selected an item... The SelectedIndex returns -1... so I cant move the item.. help!!! BensonFabonan wrote: hi there guys!!!! i have another problem... i need to get all the indexes of all the items in the listbox and save it to a field in the database how will i do it help.... Index The index of the item in the listbox is just simple, from zero to the number of the items minus one. ... ...Show All
Visual C++ strange linking error with operator overloading
Hello everyone, I am meeting with a strange linking error regarding to operator overloading. I am creating a C++ static lib, and then linking it with a C application. Here is the error message and source codes, I am using adapter.cpp, adapter.h, foo.cpp and foo.h to create a static lib called foo.lib, then link it with a C application (goo.c). There is no problem to generate the static lib foo.lib. Any comments to solve this link error error LNK2019: unresolved external symbol "private: class FooNameSpace::Foo __thiscall FooNameSpace::Foo::operator=(long)" ( 4Foo@FooNameSpace@@AAE AV01@J@Z ) referenced in function "private: __thiscall FooNameSpace::Foo::Foo( long)" ( 0Foo@FooNameSpace@@AAE@J@Z ) fatal error LNK1120: 1 ...Show All
