|
Instead of re-creating the child form everytime you double click on the parent form, re-use a single child form, showing or hiding it as appropriate. Before you show the form, you can use a DataView on the child form to show the data you're insterested in.
|
|
|
|
|
i would use a singleton pattern for the form
roughly:
public class MyForm:Form<br />
{<br />
private static MyForm _formInstance;<br />
private MyForm()<br />
{<br />
}<br />
public static MyForm GetFormInstance()<br />
{<br />
if (_formInstance == null) _formInstance = new MyForm();<br />
return _formInstance;<br />
}<br />
}
Hope this helps
Russell
-- modified at 4:15 Thursday 8th March, 2007
|
|
|
|
|
Thank You Very Much.
It is working for me.
Once Again Thank You.
Ramu Medida.
|
|
|
|
|
I would like to ask if it is possible to check the ports of a computer are being scanned?
I am writing a program to send out file and I would like to add a function to it by checking if that machine is being scanned by others.
May I know if C# can archieve this? Are there any samples?
Thank you very much.
|
|
|
|
|
A port scan works by attempting to open a port on a specific machine. Usually checks like this are done in the firewall(just disable port scanning). If you really want to check to see if your are being scanned the most likely place to look is in the WinSocks library functions available from Windows. They may offer such a hook. Other than that I know of no method to listen for port activity in Windows without actually creating a socket listener.
File Not Found
|
|
|
|
|
Hello,
Is there any way to restrict the DateTimePicker to display only the monthe and the year.
Dad
|
|
|
|
|
Yes, use an appropriate custom format; I use:
<br />
this.dtpDateTime.Format = System.Windows.Forms.DateTimePickerFormat.Custom ;<br />
this.dtpDateTime.CustomFormat = "yyyy-MM-dd HH:mm:ss" ;<br />
These can be set in the designer.
--| "Every tool is a hammer." |--
|
|
|
|
|
try setting the Format property to custom and the CustomFormat proprty to "MM/yyyy" .
Hope this helps.
V.
I found a living worth working for, but haven't found work worth living for.
|
|
|
|
|
Hai friends,
i am final ME student.
i need correct implementation of multiple description coding technique in c#.
Otherwise how to use this technique
Please help because i am doing project in MANET video communication
Narayani
|
|
|
|
|
wrote: i need correct implementation of multiple description coding technique in c#.
I did a quick google on that expression and all I found was a number of academic papers published within the last 5 years. You might get a positive response here, but you may have a better chance of receiving an answer by posting this question on an appropriate academic forum.
|
|
|
|
|
Hello all!
Iam writing a tool that will develope elearning content for the web. This tool has to be run as a clientside application. After working on web applications for so long iam really unsure about what is the best language / development tools to develope such an application in.
Ive looked into developing it in c# as this is a language iam comfortable with but iam sure unsure on the whole about developing clientside applications with .net technologies and would like to know peoples considerations on doing this.
One consideration ive come accross is redistributing the .net framework for people who do not have it already installed. Ive read this can be as little as 22mb. Another thing iam concerned about is performance. I would like the application to run as fast as any other desktop tool, but obviously there is the concern that .net languages compile to CLR so there is a processing overhead there.
Another thing is that this application will have some pretty intense GUI requirements and iam unsure if c# is the right language for doing this kind of work.
Does anyone have any council to offer on this.....please?
|
|
|
|
|
Mr Withers wrote: One consideration ive come accross is redistributing the .net framework for people who do not have it already installed. Ive read this can be as little as 22mb.
Is that really a concern. If you are distributing by CD then that is only about 4% of the disc. If you are distributing over the web 22Mb is not a lot these days.
Mr Withers wrote: Another thing iam concerned about is performance. I would like the application to run as fast as any other desktop tool, but obviously there is the concern that .net languages compile to CLR so there is a processing overhead there.
A one time overhead to compile to the most efficient code for the processor on the machine. You can distribute your app to 5 different machines and the JIT compiler will compile each differently to take advantage of the various hardware. You couldn't do that with a non-JITed language.
Mr Withers wrote: Another thing is that this application will have some pretty intense GUI requirements and iam unsure if c# is the right language for doing this kind of work.
Have you looked at WPF (Windows Presentation Foundation) in .NET 3.0?
|
|
|
|
|
I do agree that 22mb isnt alot - i guess i was kinda putting in as more of a example consideration lol, I had no idea that the overhead was a onetime only - I was thinking back to java and JVM where it run horribly slow at times. This does sound very promising.
I assumed avalon (WPF) was longhorn/vista only, one of my requirements is that it runs on XP as well (I should have mentioned this). Looking past the visual studio toolbox ill probably have to look at GDI or whatever its become now unless iam mistaken?
|
|
|
|
|
Mr Withers wrote: I assumed avalon (WPF) was longhorn/vista only, one of my requirements is that it runs on XP as well
WPF will run on XP
Mr Withers wrote: Looking past the visual studio toolbox ill probably have to look at GDI or whatever its become now unless iam mistaken?
From what I understand GDI has effectively been deprecated with the release of Vista. So long as you don't need to support Windows 2000 or earlier then I would say WPF is the way to go now.
|
|
|
|
|
Thanks this sounds like the ways forwards, ill start doing some research into these things and get to grips with them.
A bit off topic - but I have to write a video hook that ties in with this app so I can grab video sequences of the user interacting with the desktop / applications.
Just wondering if this kind of thing is possible with c# or will it be a bit of a hack?
|
|
|
|
|
hi i am using windows application...
i want to create crystal report using stored procedure pls help me..
|
|
|
|
|
Hi
i have created a Find/Replace window for my editor.
when the user clicks on the Search button on menu,
i want only one instance of this window to be created.
and if it is already opened, it should be activated..
plz help how to do it..
regards,
nas
|
|
|
|
|
make findandsearch window topmost
|
|
|
|
|
Hi Kalyan,
Thanks for your Reply.
I have got it
I have made the form declaration globally.
With Thanks
Nas
|
|
|
|
|
Hi all, I started playing around with ADO.NET, so what I did was create a database with a table called products, then I created the form, set the dataset to grid binding and then drag that table from the data source tab onto the form. It then created the gridview, added the binding navigation bar and everything, so I can view all the data, add new fields and save them.
So if I add new values in the grid and save them via the binding navigation bar it is saved to the data set and I can view every thing further in the program, but once I close the entire program and then open it again the values were never saved to the database? What am I missing or not doing?
Thanks in advance.
He who laughs last is a bit on the slow side
|
|
|
|
|
hi
dude what happens when u use a dataset it is on the on memory..
it has to effect the database dataset wont effect the database until u do it
u need to take the help of dataadapter and update the database
byebye
|
|
|
|
|
I am using a data adapter, but it looks as if it only updates the dataset and not the database. So I can create entries, update entries and it all is fine, if you go else where in the program and check the values they are 100%. But they aren't in the database it self, the changes never took effect on the database. So the next time I start the program, none of the changes where saved
He who laughs last is a bit on the slow side
|
|
|
|
|
kaylan is correct... you need to call the dataAdapters.Update() function. Only then will the changes be made to the database.
|
|
|
|
|
I do.
Here's the code to the update
private void productsBindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
try
{
this.Validate();
this.productsBindingSource.EndEdit();
this.productsTableAdapter.Update(this.productsDataSet.Products);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), "Error");
}
He who laughs last is a bit on the slow side
|
|
|
|
|
It's over a year ago that i worked with ADO.NET and C# but i try to help you
You have seriously a DataAdapter to this DB-Table.
With DataAdapter.Update() you save all the changings to the Database.
( if all Commands are correct --> To fill in (DataAdapter.Fill() to fill a Dataset) the data is easy,
the DataAdapter needs only the SELECT-Command, but to update the Table it needs
all 3 other Commands ( INSERT,UPDATE and DELETE )
Perhaps it's a problem of the Commands.
But using the Binding Navigator seems me that it works directly on the DB and not on a Dataset
( i never used this technology (only Dataset) )
But the Commands are very important.
I hope i could help you a little bit
|
|
|
|