|
Cheers, works a treat
Satvinder
|
|
|
|
|
Hello people
I am having a small problem getting my UI to work the way I would like it too, basically I need to display a list of items that is generated during the application runtime. There are two ways I can do this but I have problems with both, a solution or suggestion for either would be greatly appreciated :
1) Textbox
How can you get a Textbox to scroll to its last line? i.e. displaying the last line added to the control via .AppendText (setting focus using .focus & .ScrolltoCaret doesnt work)
2) Listbox
How can you permanently disable the vertical scrollbar on the listbox?
EDIT : In an ideal world I would prefer to use a listbox with all scrollbars disabled but I cannot find any docs about this. With regards to the textbox problem it would seem this is an MS "feature" :
http://www.dotnet247.com/247reference/msgs/5/25733.aspx
|
|
|
|
|
MrEyes wrote:
1) Textbox
How can you get a Textbox to scroll to its last line? i.e. displaying the last line added to the control via .AppendText (setting focus using .focus & .ScrolltoCaret doesnt work)
In an ideal world I would prefer to use a listbox with all scrollbars disabled but I cannot find any docs about this. With regards to the textbox problem it would seem this is an MS "feature" :
http://www.dotnet247.com/247reference/msgs/5/25733.aspx
When MS says something is by design, they are not saying that you can't override the TextBoxBase.ScrollToCaret() class method and provide your own implementation, especially when you know the default implementation only does a SendMessage(hWnd, EM_SCROLLCARET, 0, 0), which is a WIN32 message sent to the underlying WIN32 editbox.
After all, make sure you have a working WIN32 implementation, and then add SendMessage calls to your C# app. You don't even need to override the TextBox classes (TextBox and/or TextBoxBase), although it is better to do so in terms of object-oriented spirit.
MrEyes wrote:
2) Listbox
How can you permanently disable the vertical scrollbar on the listbox?
Same here. In addition, how can you think about a listbox without a scrollbar? How do you reach non visible items without the scrollbar (and without a keyboard of course) ? That would be pretty much non-standard UI. But heck, you choose. Just create your own System.Windows.Control derived class, and make sure to properly set the createparams property (that's a simple class wrapper which stores all standard WIN32 styles).
Good luck!
|
|
|
|
|
Web site: http://test.labdotnet.com/GenuineChannels/GenuineChannels.html
Genuine Channels implement bidirectional TCP channels (for .NET Remoting infrastructure) that solve the primary problem of native tcp channels and all sequential issues. Also they implement some features that help to build durable, viable and stable client-server solutions.
Brief explanation
Microsoft .NET Framework implementation of TCP channels allows using TCP channel only as a server or client connection. If you want to provide feedback from the server to client, server must connect to the client’s port. This scheme consumes two TCP sockets and is not workable if client is behind NAT or Masquerade server. Also, native implementation closes TCP connection after non-customized period of time.
Genuine Channels use the only connection from the client to the server. There is no problem if client is behind firewall, NAT or Masquerade server. Also, Genuine Channels implement some features to help building durable, viable and stable client-server solution.
Features
Only one TCP connection is used between client and server.
Fully compatible with .NET Remoting infrastructure.
Each connection has queue of messages being sent.
Constraints on the queue are possible. It greatly helps to force reconnection if current connection is too slow.
Automatic client reconnection to the server. Server and Clients does not lose messages during reconnection. It’s very useful if your server must talk to the client.
Full support of sync, async and one-way messages.
Adjustable timeout to wait for reply from the remote host.
Real async processing. You can have any number of threads at a server and at a client that will automatically use the same TCP connection.
Each exception has unique identifier that simplifies centralizing error processing or translating error messages to any language.
Automatic ping to check TCP connection if connection has not been used for (by default) 120 seconds.
Detailed logging system that receives all events and can save even the entire incoming and outcoming TCP streams as well as exceptions, stack traces and object’s guids. You can write your own logger and attach it to the system.
Dmitry Belikov.
|
|
|
|
|
|
how do i get the filename of a process?I know how to get the list of processes on a local machine, but i'd like to know how to get the full path (i.e: c:\windows\system32\svchost.exe) of a process.
|
|
|
|
|
you can use the Process.GetProcessesByName or Process.GetProcesses to get a Process object. You can then use the MainModule property to get a ProcessModule object for the process, and the ProcessModule has a FileName property that gives a full path to the processes .exe (etc.)
1001111111011101111100111100101011110011110100101110010011010010 Sonork | 100.21142 | TheEclypse
|
|
|
|
|
|
no problem.
1001111111011101111100111100101011110011110100101110010011010010 Sonork | 100.21142 | TheEclypse
|
|
|
|
|
Hi,
I am sending a file between a client and server I made and I am not sure how to detect when the file is complete. The only way I can think of is sending the size of the file to start and then continously checking to see if it has reached that size on the other end.
There must be an easier way...
If anyone could help me out a bit that would be awesome.
Thanks very much,
Steve
|
|
|
|
|
I would think that would be the best way to do it. After all, that must be what IE does when it shows you how much you've downloaded so far and how much you have left to download. Besides, then you could show some nice little progress bar.
Hey, what can I say? I'm a chick magnet...a babe conductor...a logarithm for the ladies.
-Strong Bad from HomeStarRunner.com
Essential Tips for Web Developers
|
|
|
|
|
LostInACave wrote:
There must be an easier way...
I think you could implement this type of idea..... this is not tested, just the deal.
FileStream fs = new FileStream("Test.txt", FileMode.Open);
long BytesRemaining = fs.Length();
while(BytesRemaining)
{
fs.Read(buff, offset, count);
long BytesRead = buff.Length()
BytesRemaining -= BytesRead;
}
This way your while loop will exit only when you have transfered all the data.
Nick Parker
You see the Standards change. - Fellow co-worker
|
|
|
|
|
Do you guys know of any telnet components that are commercially available? I would love to write my own (or use one here on CP), but Dad/Boss thinks going with a prepackaged solution is better. Please don't suggest IP*Works from /n software. I hate their package.
Thanks.
Hey, what can I say? I'm a chick magnet...a babe conductor...a logarithm for the ladies.
-Strong Bad from HomeStarRunner.com
Essential Tips for Web Developers
|
|
|
|
|
Im no expert [make a comment and ill track you down and castrate you!] but isnt telnet simply the transmition of raw data? in which case - you could whip one up and pretend it was a prepackaged one
1001111111011101111100111100101011110011110100101110010011010010 Sonork | 100.21142 | TheEclypse
|
|
|
|
|
real not fake? if Word has a 'real' fullscreen, what is a fake one?
Try setting borderstyle to none and setting the width and height to the primary display size, and move the form to the top left of the primary display.
|
|
|
|
|
Won't work - it'll duck behing the task bar. You have to override the CreateParams property to return base.CreateParams OR'd with the values for WS_POPUP and WS_EX_TOPMOST , using the screen's physical size for the size of the form. SystemInformation does not provide this (only the working area, which is the area that any task bars don't use) so you'll have to P/Invoke GetDeviceCaps using HORZSIZE and VERTSIZE as parameters (two separate calls) passing an IntPtr you get from Graphics.GetHdc() (make sure to call Graphics.ReleaseHdc() right away after you're done with the HDC).
You can also use ChangeDisplaySettings() (or ChangeDisplaySettingsEx() ) to accomplish the same thing, but it's a tad-bit more complicated.
"Well, I wouldn't say I've been missing it, Bob." - Peter Gibbons
|
|
|
|
|
What about PrimaryScreen.Bounds? Is that not the full screen size? ( i would test it but i've got systems issues at the moment!)
|
|
|
|
|
Well, perhaps I expressed myself in a stupid way I mean real as the one found in games and word -> no taskbars no menus or other apps (TOPMOST) should pop-up infront of the window.
|
|
|
|
|
|
I have a .NET Winform served up by a IIS server. I'm also accessing .NET Web services. When referencing the .NET Web services, the paths are hard coded. I need to setup a relative path for application deployment purposes. Can anyone help?
Thanks,
Shane
Shane L. Hatcher
|
|
|
|
|
The WinForm doesn't really know where it's running from, but there are solutions. First, it'd be nice if you could use the Value of the Url evidence presented to your AppDomain, but when a control is hosted in IE, this is always *just* the same name (MSDN Support claimed that was intentional...whatever). What you could do, however, is some of the following things:
1. Use AppDomain.CurrentDomain.BaseDirectory to get where the WinForm is running; however, this is not always correct (circumstantial, but usually correct).
2. Add a public property to your form as a string (the URL to the Web Service) and use a <param /> tag using the property name as the name and the value as the URL. Then, bind to the Web Service dynamically.
3. Specify this in your <appSettings /> section of your form's client .config file (make sure to change the handler from *.config to Web.config in your machine.config file, otherwise your form can't access its own configuration file!).
These are just a few ideas. #1 is probably the best (although prepare that - for some rare reason - the APPBASE is wrong) if you always want them to have the same relative path, but #2 and #3 allow your clients to specify different paths (perhaps even on different servers) to suite their needs.
"Well, I wouldn't say I've been missing it, Bob." - Peter Gibbons
|
|
|
|
|
Is there a way to get a raised Panel, the Border style property allows only FixedSingle, Fixed3D or None and Fixed3D only produces a sunken panel.
There is another border property Border3DStyle which allows things like SunkenInner, Raised, RaisedInner,RaisedOuter, Sunken, SunkenInner, SunkenOuter but that is for the Panel parent class.
If I could view/modify this property for a panel it would be great.
A C# example would be great. I will be creating a panel on the fly in my code.
Cheers in advance
|
|
|
|
|
I cant help you in c# but the ControlPaint class has what your looking for:-
ControlPaint.DrawBorder(_FormAreaG, Me.DisplayRectangle, Color.FromKnownColor(KnownColor.ControlLight), ButtonBorderStyle.Outset)
You have to redraw this in the paint event.
|
|
|
|
|
Change "Me" to "this" and it'll work in C#. Remember, the .NET framework provides the same class library for every language - it's only a matter of syntax.
"Well, I wouldn't say I've been missing it, Bob." - Peter Gibbons
|
|
|
|
|
Thanks to all, I have tried 2 slightly different calls based on the original code which do give different results but both work well.
ControlPaint.DrawBorder( pe.Graphics, this.DisplayRectangle, Color.FromKnownColor(KnownColor.ControlLight), mButtonBorderStyle);
ControlPaint.DrawBorder3D( pe.Graphics, this.ClipRectangle, mBorder3D);
|
|
|
|