|
people often develop chat apps and they display chat conversion between two people in simple text box or rich text box. i want to develop a chat apps where i want to design chat conversion UI area look like Skype.
1) Skype chat conversion area show the conversion where other user name show as with different color
2) user can copy text from chat conversion area by mouse selection
3) chat conversion area is capable of showing emoticons.
4) chat conversion area can show progress bar when one user send file to other then progress bar is show at two end.
so here i am uploading few screen shot of Skype chat conversion area as a result you guys can visualize and can understand what kind of UI i want to develop. please click on the two link to better understand what i am talking about.
http://social.msdn.microsoft.com/Forums/getfile/262465[^]
http://social.msdn.microsoft.com/Forums/getfile/262468[^]
the problem is i am not being able to take decision how to develop chat conversion window where i need to show chat conversion data between two user and user name too. also that area must have capability of showing emoticon and progress bar and images.
so just suggest me which control i should use to develop chat conversion windows.
1) should i use rich text box ?
2) should i use datagridview ?
2) should i use web browser control ?
i need something which can show user name and user chat data and also emoticon and progress bar.
please guide me how to develop. if possible give me some c# code. thanks
tbhattacharjee
|
|
|
|
|
Tridip Bhattacharjee wrote: please guide me how to develop Use a rich-text box. Hardest part in a chat-application will be the server. After that, it's doing the messaging on a background-thread in the client, to keep the UI nicely responsive. The UI itself is hardly relevant at that point.
I'd start with a plain textbox; once it works, make a backup. Then yank out that textbox, plugin a RTB. Or a WebBrowser. Or something more complex. (FWIW, example seems like a list of a custom-control, consisting of 2 labels and a HTML-capable label in the middle)
The datagridview would be the fastest of those controls. The browser would be ideal, given that you can simply embed emotes as pictures in the text.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
u said :- FWIW, example seems like a list of a custom-control, consisting of 2 labels and a HTML-capable label in the middle
what is the meaning of FWIW? where to download it.
tbhattacharjee
|
|
|
|
|
Tridip Bhattacharjee wrote: what is the meaning of FWIW?
FWIW is "For What It's Worth". You can build a UserControl, drop two labels and a browser on there, and you'd have something similar.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I have a WinForms application that moves a group of points around with the mouse. The code has worked fine on Win 98, XP and Vista. It was slow under Win7, until I disabled the Aero stuff and then it was fine there, too. Now under Win8 it's acting just like on Win7 with Aero activated.
I've checked to make sure the graphics drivers are updated, and even gone to Control Panel and set things for Optimum Performance rather that Optimum Appearance. No difference at all.
Does anyone know what might be done? This is a show stopper! The program uses plain GDI and is in C#.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Disable Aero for Win8
modified 19-Apr-13 15:36pm.
|
|
|
|
|
If you figured out how to disable Aero in Win 8, I'd love to hear about it. I thought about that first.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Joke is joke, but come back to reality...
The transparent borders/glass effect as Aero themes are gone in Windows 8. Many useful information you'll find here: http://superuser.com/questions/445971/disable-aero-on-windows-8[^]
Although, above information isn't friendly much, there is a possibility to disable some visual options, which can help to improve performance:
1) Go to Control Panel-> (in Icon View) click Easy Of Access Center
2) Find Explore All Setting section
3) Go to Make things on the screen easier to see section and find Turn off all unnecessary animation (when it possible) and Remove background images (when available)
4) Check both options
That's all. I hope it helps.
|
|
|
|
|
I tried all of that months ago before posting the message, even talked to Microsoft. I also investigated graphics card issues - no change.
It appears they have changed something inside the Win8 graphics kernel so that part of Aero is built-in and cannot be disabled conventionally.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
below is my routine which works fine but the routine is not generating the image of sdi form with proper height & width. here is my routine and i think there is flaw but i am not being able to capture & fix the flaw. so here is my code. please have a look and guide me what i need to change in this code to fix this flaw.
protected virtual void OnMinimize(EventArgs e)
{
Rectangle r = this.RectangleToScreen(this.ClientRectangle);
int titleHeight = r.Top - this.Top;
_lastSnapshot = new Bitmap(r.Width, r.Height);
using (Image windowImage = new Bitmap(r.Width, r.Height + titleHeight))
using (Graphics windowGraphics = Graphics.FromImage(windowImage))
using (Graphics tipGraphics = Graphics.FromImage(_lastSnapshot))
{
windowGraphics.CopyFromScreen(new Point(r.Left, r.Top - titleHeight),
new Point(0, 0), new Size(r.Width, r.Height + titleHeight));
windowGraphics.Flush();
tipGraphics.DrawImage(windowImage, 0, 0, r.Width, r.Height + titleHeight);
_lastSnapshot.Save(@".\tmp.bmp", ImageFormat.Bmp);
}
}
with the help of above routine i could generate form image and just click on the link to check.
http://i.stack.imgur.com/wCvUl.png[^]
tbhattacharjee
|
|
|
|
|
Unfortunately the ClientRectangle does not include the form borders so that is not useful for capturing the complete window. However the actual location and size is kept in the form's properties and can be used to capture the window as below. And in this case, the title bar size is not needed.
Rectangle r = new Rectangle(this.Left, this.Top, this.Width, this.Height);
Bitmap _lastSnapshot = new Bitmap(r.Width, r.Height);
using (Image windowImage = new Bitmap(r.Width, r.Height))
using (Graphics windowGraphics = Graphics.FromImage(windowImage))
using (Graphics tipGraphics = Graphics.FromImage(_lastSnapshot))
{
windowGraphics.CopyFromScreen(new Point(r.Left, r.Top), new Point(0, 0), new Size(r.Width, r.Height));
windowGraphics.Flush();
tipGraphics.DrawImage(windowImage, 0, 0, r.Width, r.Height);
_lastSnapshot.Save(@".\tmp.bmp", System.Drawing.Imaging.ImageFormat.Bmp);
}
Use the best guess
|
|
|
|
|
thanks for your answer. i got another trick that is bit small and works well
Bitmap bmp = new Bitmap(this.Width, this.Height);
this.DrawToBitmap(bmp, new Rectangle(Point.Empty, bmp.Size));
bmp.Save(@"d:\Zapps.bmp", ImageFormat.Bmp);
tbhattacharjee
|
|
|
|
|
Good catch.
Use the best guess
|
|
|
|
|
i want to detect mouse over on title bar or mouse out from title bar in my c# winform apps. i got a code sample which works but the problem is when i place the mouse on any area of win form then mouse leave occur and when i put mouse on title bar then right event call. actually i want that if i place my mouse on any area of form except title bar then nothing should happen.only when i will place mouse on title bar then a notification should come to me and when i will remove mouse from title to out of my form then label should display mouse out message but if remove mouse from title bar to form body then label should be blank.
here is code. just run this code and tell me what modification i should do to get my expected result. thanks
using System.Runtime.InteropServices;
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
protected override void WndProc(ref Message m)
{
if (m.Msg == 0xA0) // WM_NCMOUSEMOVE
{
TrackNcMouseLeave(this);
//ShowClientArea();
label1.Text = "mouse move on title bar";
}
else if (m.Msg == 0x2A2) // WM_NCMOUSELEAVE
{
//HideClientAreaIfPointerIsOut();
label1.Text = "mouse leave from title bar";
}
base.WndProc(ref m);
}
protected override void OnMouseLeave(EventArgs e)
{
base.OnMouseLeave(e);
//HideClientAreaIfPointerIsOut();
}
private int previouseHeight;
private void ShowClientArea()
{
if (this.ClientSize.Height == 0)
this.ClientSize = new Size(this.ClientSize.Width, previouseHeight);
}
private void HideClientAreaIfPointerIsOut()
{
if (this.Bounds.Contains(Cursor.Position))
return;
previouseHeight = this.ClientSize.Height;
this.ClientSize = new Size(this.ClientSize.Width, 0);
}
public static void TrackNcMouseLeave(Control control)
{
TRACKMOUSEEVENT tme = new TRACKMOUSEEVENT();
tme.cbSize = (uint)Marshal.SizeOf(tme);
tme.dwFlags = 2 | 0x10; // TME_LEAVE | TME_NONCLIENT
tme.hwndTrack = control.Handle;
TrackMouseEvent(tme);
}
[DllImport("user32")]
public static extern bool TrackMouseEvent([In, Out] TRACKMOUSEEVENT lpEventTrack);
[StructLayout(LayoutKind.Sequential)]
public class TRACKMOUSEEVENT
{
public uint cbSize;
public uint dwFlags;
public IntPtr hwndTrack;
public uint dwHoverTime;
}
}
tbhattacharjee
|
|
|
|
|
HI,
I Have Created a Desktop Winforms Application On The Basis of Wix.com Means a user can create Html templates in the Application and then Publish Them.now when a user Clicks on the Menu On Right side( Which Contains Menu For Adding Buttons and Other General Controls),The Control is Drawn on The Webbrowser control ( Setting its Editmode true).
But Whenever we add a Control is Alighned to left By Default and There is No Mean To Reorder them .
Can we implement a Functionality Which Lets Users Place Controls on Document where ever they want instead of Having Each control Autoalighned to Left.
Thanx
Tarjeet
Tarjeet
|
|
|
|
|
First, get your finger off the Shift key. You're not using correctly and it makes your post a little difficult to read.
Second, what controls are you talking about?? HTML controls?? Like INPUT tags? If so, you've got a lot to learn about writing HTML and why everything is "left aligned" by default.
|
|
|
|
|
ok but can i break this behaviour of html ??
|
|
|
|
|
You have two choices if you want to continue to use HTML.
1) Use the nightmare that is CSS positioning.
2) Rewrite the HTML spec yourself and write a parsing and rendering engine to use your new spec.
Other than that, we have no idea what you're using HTML for and what your app does, so it's pretty much impossible to suggest any other methods.
|
|
|
|
|
I am finding a new kind of memory link. Maybe not new but new to me. I have an application that generates 50 to 70 threads. I am using a vision library by a third part which generates many of them. My program is a C#/WPF. I think the library was done in C++.
I capture and analyze an image every 60 msec. After 3 to 4 hours I see the thread count for the application rise. This is well over 100,000 images. Every image creates a few threads and then closes them when finished. This spreads the load out over several core. I am watching it in Resource Monitor. Of course as thread count raises so does memory.
Has anyone seen a similar leak?
So many years of programming I have forgotten more languages than I know.
|
|
|
|
|
Do not know for sure. But you could try to call Garbage Collection manually after processing an image. Use GC.WaitForPendingFinalizers() and GC.Collect() . Maybe that helps.
|
|
|
|
|
Even if the system is not used for 5 minutes the extra threads still persists. That should be plenty of time for automatic garbage collection to get rid of old threads.
So many years of programming I have forgotten more languages than I know.
|
|
|
|
|
It's hard to say. The issue could be inside this external library, or it could be in your code. What I would do is, rather than trying to manage the threading by yourself, make use of the Task Parallel Library (TPL). This is a great way to have your code do threading without burdening you with thread lifetime issues. It's incredibly simple to use.
|
|
|
|
|
I am fairly sure it is inside the external library. It processes the images and create all the threads. I only provide an operator interface and process the results.
So many years of programming I have forgotten more languages than I know.
|
|
|
|
|
If it's in that library then you have no recourse but to notify the vendor that their library is leaking memory.
|
|
|
|
|
I have gone to the vendor. Since it takes hours and several 100,000 images they cannot reproduce it and cannot deal with it. It is kind of an exponential failure. Once you get one then there is a higher probability of getting the second, etc.
I do not expect a fix at this point but still hope. It is just a very different kind of bug than I have ever seen and in so many different ways. I was kind of hoping that someone else had seen something like this and might have some clues because it would be really nice to fix.
So many years of programming I have forgotten more languages than I know.
|
|
|
|