|
So you figured it out
Wow that's weird.
|
|
|
|
|
Try checking the DoubleBuffered property in your form and in the ControlStyles to true.
|
|
|
|
|
I have a single-selection listview, configured to view details.
It has 4 columns.
When I left-click on one of the items (left-most column), the
SelectedIndexChanged Event fires, as expected. The first time
I left-click (after the form loads), the SelectedItems.Count is 1.
For subsequent left-clicks the Event fires two times: the first time, the
SelectedItems.Count is zero; the 2nd time the count is 1.
Why is the event firing 2 times?
Thanks,
Don
|
|
|
|
|
I haven't used ListView in a long time, but my guess is that it's technically deselecting the selected item first so that it can fire the deselected event as well.
Given you don't want to take any action when nothing is selected, you could get around it by just saying this at the beginning of the method:
if(SelectedItems.Count == 0)
return;
Try to figure out the exact cause too though. It's always a good idea to know what caused a problem in the first place if you're using a workaround.
|
|
|
|
|
Hi i want to bring my form in front of all the windows those r opened b4 it but not in front of the windows wich r opened after thisssss
any sugessionsss
looking forward for help
Regards,
|
|
|
|
|
I'm not sure there's a way to do ittttt
You could try setting TopMost to true and then disabling it right awayyyyyy, but that probably won't make it stay in front of the other topmost onessssssss
|
|
|
|
|
how can i change this property through coding coz it is not visible there suppose if the name of the form is form1 then form1.TopMost is not available so how can i change it ??
looking forward for help
Regards,
|
|
|
|
|
Really? It shows up fine on my machine. I'm on VS2005.
Try doing it in the designer and then dissecting InitializeComponents().
|
|
|
|
|
reinux wrote: dissecting InitializeComponents().
well wot does this mean i cudn't understand plzz explain a little
|
|
|
|
|
When you design a form, all of the code for the code gets put in the InitializeComponents() method that gets called by the constructor.
Just read through that and see if you can find out how it's setting TopMost, and copy that line of code.
|
|
|
|
|
thxx sir, its done by this.TopMost
do i ve also done the same
|
|
|
|
|
hi,
I have a datagrid in windows applicaiton ..I have a data table in database whicha have around 5 columns..& now i want to show 3 columns only from that table to this datagrid..
I have been working in wwebapplicaiton. Its easy in webs application to do this. but i m confused how to do this in windows datagrid form..
In otherwords i must say that is there any way to handle the datagrid as we do in webapplication..
Any one can help me....
-- modified at 16:33 Tuesday 16th May, 2006
|
|
|
|
|
|
One way would be to populate the DataTable with only the 3 columns you want from the database and then set the datasource property to it. i.e. Use a SQL query to retreive from the database only the information you want to fill the datatable with.
|
|
|
|
|
Hi.
What is pdb files ?
Best wishes
|
|
|
|
|
From MSDN
program database (.pdb) file
A file used to store symbolic information about the compiled application.
Michael
CP Blog [^] Development Blog [^]
|
|
|
|
|
hello everybody in this forum.
i need to ask one question.
i had implemented multicast chat room to connect to multicast enabled ip address and on a specific port.
that's ok......
actually all users will be connected to that chat room who will connect to that ip address with that port pair.
but what if i wanted to create multiple chat rooms .
does that mean i will use multiple ip addresses and multiple ports for creating multiple chat rooms or it is only one ip address and port pair that i will relay on but with additional coding ?????
Human knowledge belongs to the world.
Human knowledge belongs to the world.
|
|
|
|
|
Hello snouto.
Any network program generally falls into two main categories. Either it's client/server app where all clients connect to one server, or it's a peer-to-peer where all apps act as aclient & a server in the same time.
So, whether your program is from the first type or the second (usually chatting programs are from the first type, but you can make p2p chatting program), you use one IP to listen to, but you may liten on different ports using multiple "TCPListener"s for each port. So there will be a listener for each port and each room will have a name and a port. This way Your server may have multiple chatting rooms (each on a different port), and you may add more rooms (or remove) at run time.
If this isn't what you were looking for, or you need more clarification, just ask.
Happy programming.
|
|
|
|
|
I am trying to process some work in the back ground so my UI is not locked up. This is what I have currently:
private void btnPHourly_Click(object sender, EventArgs e)
<code>{
string tempDestination = FileCopier.Properties.Settings.Default.PHourlyPath.ToString();
string tempRemoveable = FileCopier.Properties.Settings.Default.RemoveableDiskPath.ToString();
ValidatePaths(ref tempDestination, ref tempRemoveable);
DisableButtons();
CopyFiles cf = new CopyFiles(tempDestination, tempRemoveable, ExtensionFlag);
EnableButtons();
}</code>
I want to CopyFiles cf = new CopyFiles(tempDestination, tempRemoveable, ExtensionFlag); process to work in the background. How can I implement the BackGroundWorker in this scenerio?
Since I cant pass parameters (such as tempDestination etc) to bgworker I am not sure how I can acomplish this. Can someone up here help me with this issue? Thanks in advance.
|
|
|
|
|
What is "bgworker" and why can't you pass it a string?
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
Well you can pass parameters. The RunWorkerAsync can take an object parameter which will be transferred to the event arguments of the DoWork event callback. You could argue that it is only one parameter and that you need several ones but this is not really a restriction because you can stuff anything you like into that parameter like an ArrayList filled with values, a Hashtable or plain an object array.
using (BackgroundWorker bw = new BackgroundWorker()) {
bw.DoWork += new DoWorkEventHandler(bw_DoWork);
bw.RunWorkerAsync(new object[] { tempDestination, tempRemoveable, ExtensionFlag});
bw.DoWork -= new DoWorkEventHandler(bw_DoWork);
}
private void bw_DoWork(object sender, DoWorkEventArgs e)
{
object[] o = (object[])e.Argument
CopyFiles cf = new CopyFiles((string)o[0], (string)o[1], (string)o[2]);
}
Not tested but should work
|
|
|
|
|
hi
i'm making a form in VS.Net .When i debug the code,i want my textbox come with grids.
But i dont know how i drawing grids to the textbox and show it when the form run.That is in one way,i want to use InitializeComponent() method.
how can i do it
thanks
|
|
|
|
|
You cannot use grid in textbox. Use DataGrid instead.
It is simple to use datagrid. Just put datagrid in your
form. Then fill datagrid using datatable.
e.g. :
DataTable dataTable = new DataTable();
dataTable.Columns.Add(new DataColumn("X", typeof(int));
dataTable.Columns.Add(new DataColumn("Y", typeof(int));
for(int i = 0; i < 10; i++)
{
DataRow dataRow = dataTable.NewRow();
dataRow["X"] = i;
dataRow["Y"] = i;
dataTable.Rows.Add(dataRow);
}
this.dataGrid1.DataSource = dataTable; Now you can see a table with X and Y column, fill with number 0 until 10.
|
|
|
|
|
i will study about this , thank you very much stancrm;)
|
|
|
|
|
If I've got a WeakReference:
private WeakReferences weakRef = new WeakReference();
...
weakRef.Target = new string[...];
Am I guaranteed the following will always work?
if(weakRef.IsAlive)
{
string[] args = (string[])weakRef.Target;
}
Isn't it possible that the garbage collector will kick in right after the IsAlive check, thus collecting the object before I can get the Target?
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Islamic Domination: Coming to a Jewish state near you!
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|