|
You'd have to iterate through the hashtable's keys and get the client sockets. You'd then have to get the NetworkStream and write to it.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
I'm having quite a problem figuring this out. In the microsoft SDK i found some functions to make controls transparent:
<br />
SetStyle(ControlStyles.SupportsTransparentBackColor, true);<br />
this.BackColor = Color.Transparent;<br />
and they said something about it had to be placed in the constructor????? Kinda lost. Can i apply this to the standart listboxes in the .Net framework, or do i have to create my own control which inherits the functions of a listbox?
thanks in advance!
|
|
|
|
|
can't you just change the opacity?
|
|
|
|
|
ListBox doesn't support transparency on it's own. If you want a transparent ListBox, then your going to have to create your own, inheriting from the current ListBox control and adding the code you posted. Search the articles for "custom listbox" and you'll come up with some examples.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Okay.. I'll do that!
Thanks a lot for the help
Regards!
**EDIT**
Back again. Now i have created a inherited custom control with listbox attributes. But when i set the color to transparen they just turn white. The thing is that you have to be able to see the picture behind the listboxes. Hope some of you have a solution to this!
|
|
|
|
|
I'm a musician and beginner to programming. I want to make music programs. What can I do?
|
|
|
|
|
Really it's very strange and nice to give you an answer.First of all you have to go in www.google.com.Type your question (how to make programs related to music).You can definitely get some help from it.You may also go in www.MSDN.com . You can also get help from it.
P.J.Contractor
|
|
|
|
|
|
Hey!
I'm working on some code that reads a .csv file into a datagrid. I'm using OdbcDataAdapter. It works fine with file names with no spaces in it - how do I do it with file names that have spaces in it. I've already tried [FileName] in the Select query. Please help
my code:
<br />
string ConnectionString =<br />
@"Driver={Microsoft Text Driver (*.txt; *.csv)};DBQ=";<br />
OdbcConnection conn = new OdbcConnection(ConnectionString);<br />
conn.Open(); <br />
<br />
OdbcDataAdapter da = new OdbcDataAdapter("Select * FROM " + FileName, conn); <br />
<br />
DataSet ds = new DataSet();<br />
da.Fill(ds,0,20,DataMember());<br />
<br />
conn.Close();<br />
chukkkzn
chukkykzn@webmail.co.za
|
|
|
|
|
Hi,
I have a win Application in which I use toolbar bottons.when I roll over the buttons my computer CPU usage shows up to 70 % percent CPU usage.
More info.
I use .NET Framework 1.1
Any help would be apprecited
|
|
|
|
|
Hi i want to sort the tree nodes,but only the nodes which i want.For example
-A
+AA
AAA
-N
-XX
-ZZ
-F
EE
HH
+B
+Z
Now i only want to sort the nodes present between Node A and Node B,measn i want to sort node N and F.can anyone helps me in this regard
|
|
|
|
|
You can work with the nodes collection of the tree control. Since nodes can contain child nodes you may need to apply this recursively.
What I typically do is put the nodes I want to sort into an ArrayList. This is pretty trivial since the ArrayList constructor can be passed the TreeNodeCollection directly. I then sort the nodes appropriately -- if you want to get fancy you can create one or more classes which implement the IComparer interface for tree nodes and then use the ArrayList.Sort(IComparer) routine.
Then clear the existing nodes and add the resorted nodes from the array list.
For example, if nodes is the TreeNodeCollection and alNodes is the array list...
nodes.Clear();
nodes.AddRange((TreeNode[])alNodes.ToArray(typeof(TreeNode)));
I've been thinking about writing an article which shows this in some more detail.
Regards,
Chris
|
|
|
|
|
Thx Chris,
But now u can consider one more problem with this,now if u add or delete nodes and expand or collapse diffrenet nodes,then after this if u sort the nodes and assign to the tree,then the previous STATE of the tree is not retained,means all the tree nodes collapse again.
Tree STATE can be retained in another array list for expand or collapse node(array list conatins node info which are collapsed and expanded) and while redrawing the tree we can maintain by checking the previous status of the nodes,but this all we have to do recursivly,this makes system slow.If the tree is really big then its a real problem itself.
Now can u help me again considering these situations.
My english is really bad . As its not my native language.
Regards,
Umair
|
|
|
|
|
It doesn't seem like it would be difficult to reapply the expanded or collapsed state of the nodes during the recursion -- I'm actually surprised its necessary since expanded/collapsed is a property of the individual nodes and all we are doing is reordering the references -- perhaps the state gets reset when the nodes get re-added to the tree control (I haven't tried it so can't answer with certainty).
Once you've sorted the tree once you may want to handle inserted nodes in a slightly different way -- that is, the code which creates the node would also determine where the node should be placed. Its more work but might be preferable to resorting the branch every time a node is added. Again without actually trying it I'm not sure if this is difficult or not.
When sorting a large tree I would try to make use of SuspendLayout() and ResumeLayout() so that screenupdating is a non-issue. I would guess that once you have done this your tree would need to get very large before sorting gets slow.
For really large trees, recursion could be an issue -- although when you think about it, its really only the depth of the tree that matters. If recursion is no longer viable to get to the maximum depth in your tree chances are that your users probably hate you (who wants to drill down through a hundred nodes to find something?). Same comment stands for the number of nodes in a tree -- you can sort thousands of items in no time so the tree would have to be huge before it got to be a problem. At that point you're probably into virtual trees which you populate as the user is expanding them.
One last comment. I've done treeview sorting the old fashioned way (in C++ with callback functions and TV_ITEM structures). It was pretty painful. Given the choice I'll take the .Net approach any day.
|
|
|
|
|
OKz,
I will try the way which u have told me.
Thx n regards
Umair
|
|
|
|
|
Here's the deal. I got an image of a building plan loaded in my Picturebox.
Now I have to mark the rooms on it... and to a room I need to assign certain parameters.
2 problems:
1. I need to use a kind of magnetic lasso tool or pen tool (photoshop) to mark the rooms
2. how do I draw "object/controls" on top of an image?
Thanx in advance
"Paranoia is reality on a tighter edge"
|
|
|
|
|
From GDI+ you can use Graphics.Draw//anything() .
but at this you must make that image the background image.
|
|
|
|
|
I'm currently experementing with Graphicpath... and seems to work out great.
|
|
|
|
|
Hi folks,
Do you guys know how to check if a folder is shared and what users have permission on it?
Thanks.
|
|
|
|
|
I have to use SQL queries and generate a dataset and then attach it to a crystal report. All this to be done through coding and not using any experts
i wrote the following ...but it showed a blank form . Please Help
string st="server=localhost;user id=sa;password=ims;database=ProActiveTrainingDB";
SqlConnection s=new SqlConnection(st);
SqlDataAdapter sd=new SqlDataAdapter("Select * from JobTitleMaster",s);
DataSet dset=new DataSet();
try
{
sd.Fill(dset, "JobTitleMaster");
bRpt.SetDataSource(dset);
crystalReportViewer1.ReportSource = bRpt;
crystalReportViewer1.RefreshReport();
}
catch(Exception ex)
{
MessageBox.Show("Report causing Problems");
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
Sukanya
|
|
|
|
|
I wrote a control. It is a timer with 1 button (Start/Stop) and 3 readonly textboxes to show the start time, stop time, running time. It also has a public method Start() which is also used in the ClickEvent of the button to start the timer. While the timer is running, the textbox that shows the running time is updated every second.
Here's the weird part. When Timer.Start() is called in another thread, the textboxes that should show the details are not updated on a certain interval. The reason why I put the call to Timer.Start() in another thread is that it's called by a remote host via sockets. The remote host sends its hostname which corresponds to a certain field in a set of MyTimer controls.
The update is in the Tick event of a Timer control within my control. I tried putting messageBox routines and I did find out, they are not executed. The Tick event does not fire!!! The timer works fine when using the start button to start it. Is this due to the fact that the event occurs in the _main_ thread?
Please enlighten me about this weird behaviour.
|
|
|
|
|
From your description, it looks like you are System.Windows.Forms Timer. That Timer's Tick event is on the UI thread, so you should be fine there. I'm wondering about calling Start from another thread though, maybe you should use Invoke/BeginInvoke and call Start on the UI thread? According to MSDN documentation, no UI method/property on any control may be called from another thread, except for InvokeRequired, Invoke() and BeginInvoke().
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi Senthil. I use the asynchronous Begin/EndInvoke and it works!
|
|
|
|
|
Following is my code for a simple thread
public static void U()
{
IPEndPoint ipe = new IPEndPoint(IPAddress.Any,1238);
EndPoint LocalEP = (EndPoint) ipe;
//Socket ServerSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
//ServerSocket.Bind(LocalEP);
Console.WriteLine("I am codeproject user");
while(true)
{
Thread.Sleep(10);
Console.Write(". ");
}
}
It is surprised that when I use
//Socket ServerSocket = new Socket(AddressFamily.InterNetwork,SocketType.Dgram, ProtocolType.Udp);
the thread is not working .
|
|
|
|
|
Funny... I don't see any code in your post that creates a new thread, so yes, it doesn't work.
What are you trying to accomplish? I assume it's a multithreaded server application that accept client connections and launches a new thread for each client. But in your case, you never started a listener, so I fail to see how your even going to accept connections...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|