Answer Questions
huysmans Pushing data into winforms clients.
Anyone have any advice on pushing data into winforms clients I need winforms clients to listen for changes made to a sql server 2000 database and automatically update itself. Is this possible Perhaps using .net remoting I was thinking about how to do this, and my line of thinking is this: I would write a c# service which would have a list of all connected clients and methods which would be called to update the database. So the client applications wouldn't call sql server directly, It would call methods on the service letting the service know it wants to update something on the database and if successful, notify all connected clients. Does that sound correct How do the big boys make apps like instant messengers, games, etc. ...Show All
Thrix How to change the icon beside a filename in windows explorer?
Can someone please tell me how to change the icon beside a filename in windows explorer I use Visual Studio to create some icons and wish I can change the icon beside these icon filenames in windows explorer to look similar to the icon themselves. Thanks! See this article : How to Change File Type Icons and File Types Thanks Zhi-Xin Hi Brendan, Thank you for the reply and sorry for the confusion. I want to have explorer display the icon as the icon of the file that contains the icon. Thanks. If you view the files as "Thumbnails","Titles","Icons" mode, the effect is exactly what you wa ...Show All
Ken Villines creating types
Hi, i have this issue.. see code Public Sub NewForm( ByRef i As Form) If Not Forms.Contains(i) Then myType = i.GetType() i need to create an instance of i here. at this point i do not have i declared on the same form. this form is a base form inherited. how do i do .. i = new theType it is. Forms.Add(i) i.MdiParent = Me m_ChildFormNumber += 1 i.Show() Else End If AddHandler i.Disposed, AddressOf Form_Disposed AddHandler i.LostFocus, AddressOf Form_LostFocus End Sub would i then go i = new baseType would it be like class bird{ int numberWings; } class pigeon inherits bird{ boolean eatsAlot; } pigeon myPigeaon = new Bird() ...Show All
Prashweenet Get the parent Control object...
I have a non-visual class like (avalible in the toolbox) public class MyClass: Component { public MyClass() {...} } In this class I have some asyncronus external events that needs to be syncronized with the "main - gui - thread" that consumes events from "MyClass"... Before I made a "toolbox" component of "MyClass" I hade a constructor like public class MyClass: Component { public MyClass(Control parent) {...} } This way I had the "parent" object to sync with... But using MyClass as a component in the "toolbox" forces me to have a constructor without any parameters... I need to get hold of the parents "Control - object" inside of "MyClass". How ca ...Show All
freadomfee Opening / Closing Forms
Hey guys, Really simply, how do you open forms when you click a button! ! (i.e. in VB its docmd.open 'Form'). I just want to click a button and it pop up another form i have designed. Thanks in advance Tom Is that true I just ran across a situation where I tried to open a form from another form using Form.ShowDialog() in the code for the button_click. The form displayed as though I were using Show(); Form.ShowDialog(this); worked. What did I do wrong Well, you create an instance of your form and display it using ShowDialog(): Form1 form = new Form1(); form.ShowDialog(this); (The parameter to ShowDialog() is made the parent of the form which is displ ...Show All
pat27 Custom Form Control (Label)??
Hi: I'm trying to create a TYPE that is a Label but with the Font and margins changed. I've learned that the font size, etc. are not available to write at run time. So, I need to be able to create a new Label at run time but with slightly different property values than the stock Label. I can't figure out for the life of me how to do that. I can create a User Control and put a Label on it but I really just want a slightly different Label. Can I do that in VS 2005 C# If so, how Sure there is. Create a new class and inherit from label - you can then treat it like a label in every way public class SomeCustomLabel : Label { public SomeCustomLabel() { //Set custom properties here } } Now, in other ...Show All
Alvin Kuiper How do I reference a control's properties?
I am new to VC++ but not to programming. I am trying to change the Text property off a textbox when I click a button. However I cannot determine the proper syntax to reference the text field. Form name - Form1 Textbox name - Textbox1 Button name - Button1 In Button1.Click I tried the following - all of which fail compile Form1::Textbox1->Text = "Hello World" ; /* error C2227 */ Form1::Textbox1.Text = "Hello World" ; /* error C2228 */ Textbox1.Text = "Hello World" ; /* error C2065 */ This can't be that hard, but I can't find where it is documented. If you're inside a form event (like a button click), then something lik this should work: ...Show All
Luis Ramírez V. Binding DataReader to a DataGrid
Hi, I've this code below I'm trying to bind the DataReader to the DataGrid and i get nothing Do i need to add something Private Sub ProjectIDComboBox_SelectedIndexChanged( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ProjectIDComboBox.SelectedIndexChanged Dim test As String = Me .ProjectsComboBox.Text Dim test2 As String = Me .ProjectIDComboBox.Text Dim strSQL As String = _ "select * from Auctions where ClientName = @test and ProjectID = @test2" Dim objCommand2 As New OleDbCommand _ (strSQL, objConnection) Dim parm As OleDbParameter = objCommand2.Parameters.Add( "@test" , OleDbType.VarChar, Me .ProjectsComboBox.Text. ...Show All
AllanP extend binding navigator service
Hi I want to add two button controls to the binding navigator for query by example first button: filter , in that case , all controls of the form are cleared , and user can enter values in the controls. second button: apply filter, when user click it , the filter which is composed by reading every control value is applied to the base table and data is reterieved. i want to add these services to the binding navigator . can you help me thanks in advance string fieldName = tx.DataBindings[0].BindingMemberInfo.BindingMember; DataTable dtable = ( DataTable )bs.DataSource; MessageBox .Show(dtable.Columns[fieldName].DataType.ToString()); hi Zhi-Xin Ye - MSFT i have a form with set of text ...Show All
Tareq Ismail ListBox drag and drop
Hi, I'm trying to implement the drag and drop event on a ListBox. What I want to do is to drag an item to another location within the same ListBox and drop it there. I'm wondering if there is a way to display a dotted line at the index the item is dragged into at DragEnter, like many windows applications do. Thanks. Something that used to be on the .NET 1.1 Windows Forms FAQ (See the OnDrawOver method): namespace DragDrop { using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; /// <summary> /// Summary description for Form1. /// </summary> public class ...Show All
lkurts how to use a webbrowser control
I want to create a windows form that allows a user to "define" fields (i.e. labels and textboxes) for a web page. I then want to use the webbrowser control to display a web page with the fields specified by the user. However, I am not familiar with the webbrowser control. So, can someone tell me how to pass html to a webbrowser control thanks, Dexter I have seen that mentioned in other posts. However, the browser object that I am using does not have DocumentText as a property. I am using Visual Studio 2003. There is a Document property but it is read-only. Is it possible that I am using the wrong control The namespace for this control is AxSHDocVw.AxWebBrowser (although the control in the toolbox says, " ...Show All
Kennon2005 Screen resolution affects GUI
Hi, I've developed an windows application in VS2003 (VB.NET) and set form window size as maximized. Problem is, GUI affected b'cos of different resolution in deployment PC. My Development PCs Max .Resolution is 1400 x 1050 (32 bit). Deployment PC has a Max. resolution of 1024 x 768. Many controls are out of the screen. How to bring the exact GUI what i designed before . I've seen an article in Code Project. but i Couldn't get a clear Picture abt the concept. Sometimes Manually , I'm adjusting the GUI. Please give me good solution for it. I want to design an apps that fits to all kind of screen. Thank You! You are correct. Your alternative is to recalculate control positio ...Show All
Will Merydith Text field/box
Task: I have a text box with maxlength property set to 0. What I want to accomplish is to determine whether an overfilling of the text box has occured. Example if you enter a text beyond the visual space or width of the textbox. Example: TextBox _txt = new TextBox(); _txt.MaxLength = 0; _txt.Text = "Yandisa Mtyide has been developing in C# for the last 10 months"; _txt.Width = 60; //Basically the text will overfill the text box, so if this occurs I want to notify the user that the textbox has been overfilled Thank you Note that the MaxLength property has no effect on the length of the text when it is assigned through the Text property. It only restricts user input. I cannot mark my answe ...Show All
Amos Soma Ambiguous match found
On an inherited windows form I am getting this error, and I have no idea where to start to try to fix it. It has happened to several, but not all of my inherited forms. Sometime I get this in my error message box, but not always. Warning 1 The service System.Windows.Forms.Design.IEventHandlerService already exists in the service container. Parameter name: serviceType 0 0 Any help not having to redo my screen would be great. It compiles, and runs just fine. Thanks Will Have a read at this thread . ...Show All
JeffNick Screensaver Events and performing functions just prior to ss execution.
Where do I go to find out about performing functions in .NET just prior to a screensaver execution, and subsequentially a logoff from the app ===================================================== Here's the question I will be asking: Can someone help me code the following Just before the screensaver (Windows XP) kicks in, I want my program to do some basic functions (set a variable, save a record, and close a form). How can I get the form to recognize that the screensaver is about to kick in, (and this particular screensaver will log the user out of the app), and perform the code prior to screensaver execution It's that simple. Is there a simple answer If you have me writing extra classes for this, PLEASE treat me as ...Show All
