Answer Questions
Robbbbbb Refresh DataBinding
Hi, How can I manually trigger a databinding to refresh my controls binded to a datasource. (DataSource have been updated behind the scene.) Similar to Page.DataBind() in ASP .NE RefreshBinding doesn't exist on PropertyManager casll obtain from BindingContext[]. RefreshBinding Only exist on CurrencyManager object. Framework 2.0 handle this problem. To Reset the contents of every control and change what it is displaying manually run this code (in c# but vb.net conversion is easy): foreach ( Control ctl in this .Controls) { ctl.ResetBindings(); } Check out the CurrencyManager documentation on MSDN. Also take a look at the BindingContext information as well. To just call Refresh on every Curre ...Show All
iainatk Application.Exit(); not working when backgroundWorker.IsBusy!
Can you please tell me why is that and how can I solve it if (backgroundWorker.IsBusy) System.Diagnostics. Process .GetCurrentProcess().Kill(); Application .Exit(); Does the work, but I have a feeling that this is not a proper way to do it! Please help. Thank you in advance. hi, I am facing exactly the same issue as faced by aztec2_step . ( i.e. that of a singular long-running worker-process ). Is there a decent solution to this issue Thanks in advance. It is the thread's responsibility to check CancellationPending and exist gracefully. If the operation ...Show All
Roopesh Babu Valluru Scrollbar position
Hi, when I use AutoScroll in a Panel and place a control within it (setting Left and Top properties), the reference position (0, 0) is always the upper left corner of the visible panel area, irrespective of the current scroll bar position. Of course this poses some problem when the user moves the scroll bar and then a controls position is manipulated relative to the reference position. Is there a possibility to fix it E.g. setting the position of the scrollbar or something else Thanks! Correct. You must use the AutoScrollPosition to adjust any painting that you need to do. I recommend that you pick up Charles Petzold's Programming Microsoft Windows with C# for a great discussion of scrolling and WinForms ...Show All
Flack how to include MSDE with install
I am writing a Windows Forms application (but my background is web applications). I will be creating a database using SQL Server 2005 or 2000. When I am ready to create an installation package, I want to use MSDE as part of my application. So a couple of questions: 1) How do I include MSDE as part of the install 2) How do I get the database included as part of the install package 3) Is there any documentation available that defines how to create/use database with MSDE and distribute them thanks Dexter Here is something I found on the following url http://www.installsite.org/pages/en/clickonce.htm "ClickOnce requires that version 2.0 of the .NET framework is already installed on the target machine. You c ...Show All
Keith Newton beep generates no sound
the Beep method generates no sound, the volume is on i checked Remco Either method mentioned requires the Default Beep to be set in Sounds and Audio Devices. Rather get your own .wav file and play it, if you require it to be played even if sounds are off. ahmedilyas wrote: Is there a sound attached to (im unsure but maybe) the notify sound event in Windows I can not check because of the configiration policy here @ work remco ahmedilyas wrote: secondly, some code would be nice for us. I'm not sure what you mean here but it's just the method beep() in for example in a clickhandler of a button like so Private Su ...Show All
JFoushee Proper splash screen design - .NET framework load delay
Hello everybody, I want to ask what is the best practice for splash screen design. Should the main method start two separate threads for the main form and splash form Or some other approach Like the main form spawning the splash thread Because I'm rather confused, I've been reading quite a few articles on splash screens all use different approaches and entry points. So I just wanted to ask what's the best practice about the problem. Any advice is greatly appreciated. Regards Although you could use two threads, one for the splash screen and one for main form, it is not required. I spawn and show the splash screen before even creating the main form and then when the main form is created, set the sp ...Show All
FlyinBrian How to put new row at the top of the datagrid.
I have a comment datagrid, which store comment in desc. order( the most recent listed first) I wonder is there a way to put the new row at the top instead of bottom of the datagrid Thank Shogo. I have tried it and since it is a databound grid, there is an error message said Cannot add row programmatically. DataGridView.Rows.Insert(0, DataGridViewRow); ...Show All
MLyons10 Press Esc key to close a form containing many controls
Hi, I would like to find a way in C# so that, when the user presses the “Esc” key, the form closes; the problem is that I have a lot of controls in the form. At the beginning I have tried with the following form event handler: protected override void OnKeyPress( KeyPressEventArgs e) { base .OnKeyPress(e); if (e.KeyChar == ( char ) Keys .Escape) Close(); } But I have realized that it functions only if there are no controls in the form. Suppose that you have three Buttons in the form (btn1, btn2 and btn3). The fastest way (with the minimum number of code lines) I have found to close the form pressing the Esc key is the following one: ...Show All
VooDoo Chicken How do I get the install path in my setup project?
When I use VS2005 to make a setup project,i need to run some bat files, in which some contents include the installing path,so how can I can it in my install function 3Q for help! ...Show All
Ori' Best way to handle shortcuts ?
Hi, I was wondering if there is a good OO-way to handle keyboard shortcuts. Atm my shortcut handling code consists of a big list of if else if else statements containing switch statements (if/else to detect the modifiers, the switch statement to handle the keys) As you might have guessed, this is ugly and not very clean. I tried using a Dictionary of Keys to Action (a simple void delegate) mapping. but the problem here is that the keys pressed never match those in the dictionary because extra modifiers and flags are present. I was wondering if anyone has any suggestions how to make a decent key to action mapping. Thanks, Ben. A short-cut key should always have a mouse-clickable alt ...Show All
wunda XML tree Mapper
Hi, I need to privide my users with a visual interface do map values from diferent xml messages, just the the biztalk Mapper. e.g: MessageA.FieldX goes to MessageB.FieldY , and so on .... something like the biztalk mapper Any thing like this really appreciate that. tks D ...Show All
Blader Control textbox, promtly
How I can limit textbox control So, when I must input decimal number, but, if I make mistake and input text or integer, system must alert me that I can input onli decimals numbers. I know for maskedtextbox. Dou you have another choice. Please help me and thx. Thx you SvenC but it's very complexly for me, I am beginner. So I need something what I can use very fast, and very simple. Well, a MaskedTextBox would really do the trick. However, if you don't want to use that, you could validate the user input with a regular expression for example when the control leaves focus. Something like the following: private void textBox1_Leave( object sender, EventArgs e) { if (! Regex .IsMatch(textBox1.Text, @" ...Show All
craigmh Monitoring Changes on a Tab Page
In my WinForms app I have a tab page with a bunch of controls on it (e.g. textboxes, checkboxes, buttons, radio buttons, etc.). Is there an event, or a few events, of the tab page that I can monitor to see if any changes to any controls on the tab page have been made Robert W. http://pocketpollster.com Thanks, Peter! It is not the selecting of the tabs I'm interested in but the altering of controls on a tab page. I thought perhaps there was a "Parent Control" event that would be fired when anything happened to any control on a tab page. Apparently not. Robert There's things you can do, like iterating through the tabpage's C ...Show All
Zulbaric DataGridView Seek
Hi, Is some way that I can make a search in a datagridview not whit Loops (For, while). I remember that the datagrid in VB 6 has a Find or Seek method that does this. I don’t remember the correct syntax but it was something like this: DataGrid1.Seek = “field LIKE ‘” & textbox1.text & “%’” Datagridview has that method or is some way that i can do this not sure I quite follow - the focus will be changed to only show the criteria matched records when bound to the datagridview Hi, What I want is something like this: Public Sub FindMatch(ByVal Match As String) If DataGridView1.RowCount > 0 Then &nbs ...Show All
Haziman skins
hi i am looking for some skins to use them with VC++ express ...Show All
