|
Create a common data class, have it implement INotifyPropertyChanged and code the GUI (and possibly the Console class) to handle the event.
At least thats how I'd do it.
------------------------------------------------
I'm largely language agnostic -
After a while they all bug me
------------------------------------------------
|
|
|
|
|
Thanks for the suggestions. I got more suggestions elsewhere, some similar, some different. I will process them all now
|
|
|
|
|
hi ...
i want to encrypt content of my page and then send by socket to my friend
and then he decrypt it (by a program) in the other client
until now i can encrypt the content but i don't know how can encrypt ...
my algorithm to encrypt in simple . i just 1 to each byte as follow :
sBuffer = sBuffer + sHttpVersion + sStatusCode + "\r\n";
sBuffer = sBuffer + "Server: cx1193719-b\r\n";
sBuffer = sBuffer + "Content-Type: " + sMIMEHeader + "\r\n";
sBuffer = sBuffer + "Accept-Ranges: bytes\r\n";
sBuffer = sBuffer + "Content-Length: " + iTotBytes + "\r\n\r\n";
Byte[] bSendData = Encoding.ASCII.GetBytes(sBuffer);
//encrypt content ...
for (int i = 0; i < bSendData.Length; i++)
{
bSendData[i] += 1;
}
SendToBrowser(bSendData, ref mySocket);
|
|
|
|
|
Unless you write a specialised plugin or browser you're friend won't be able to decrypt this in IE or Firefox by default. You'll have to write your own "browser".
BTW what's the problem with using HTTPS, performs the same function?
|
|
|
|
|
hi
i was looking for a c# code that uses tapi3
to control the status(specially when connected and disconnected) of a call
and also that detects the numbers that the caller pressed on the handset
befor making the call.if any one have such sample code please send me .
i relly need it.
thank u.
thanks
|
|
|
|
|
hi
i need a dataGridView footer source Code that study about how to implement and draw footer at bottom of Standard DatagridView, thanks
|
|
|
|
|
It's already there. RTFM
only two letters away from being an asset
|
|
|
|
|
Hi,
I'm trying to move a control while clicking on it. it works but very bad!
When i click the control down (panel), and start moving it, it is continuosly swaping between two position and i cant find a reason for that behaviour.
This is my code (only the event handlers):
<br />
private void panel_MouseDown(object sender, MouseEventArgs e)<br />
{<br />
Console.WriteLine("mouse down");<br />
Panel region = (Panel)sender;<br />
<br />
drag = true;<br />
}<br />
<br />
private void panel_MouseUp(object sender, MouseEventArgs e)<br />
{<br />
Console.WriteLine("mouse up");<br />
drag = false;<br />
}<br />
<br />
private void panel_MouseMove(object sender, MouseEventArgs e)<br />
{<br />
if (drag)<br />
{<br />
this.SuspendLayout();<br />
Panel region = (Panel)sender;<br />
<br />
region.Location = new Point(e.X, e.Y);<br />
<br />
Console.WriteLine("Panel position: (" + region.Left + "," + region.Top + ")" + "mouse position: (" + e.X + "," + e.Y + ")");<br />
this.ResumeLayout();<br />
}<br />
}<br />
Someone has given me an answer to this problem using user32.dll but i want to have more control of the thing.
Can anyone help me?
Thx
Nuno
|
|
|
|
|
Hello,
At the MouseDown you have to store the starting point:
_startDragPoint = new Point(e.X, e.Y);
At the MouseMove I suggest you to use a timer which only changes the Location every 100ms.
And add this logic:
if(TimerMovePad == null)
{
this.TimerMovePad = new System.Timers.Timer();
this.TimerMovePad.Interval = 100;
this.TimerMovePad.Elapsed +=new System.Timers.ElapsedEventHandler(TimerMovePad_Elapsed);
}
if (TimerMovePad.Enabled == false)
{
TimerMovePad.Enabled = true;
}
if(_movementok == true)
{
_movementok = false;
int delta_x = e.X - _startDragPoint.X;
int delta_y = e.Y - _startDragPoint.Y;
region.Location = new Point((region.Location.X + delta_x), (region.Location.Y + delta_y));
}
At the timer Elapsed, you then set the flag.
private void TimerMovePad_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
TimerMovePad.Enabled = false;
_movementok = true;
}
Hope it helps!
All the best,
Martin
|
|
|
|
|
Hi Martin,
While i was waiting for an answer i kept trying.
I got it! And it was pretty simple!
New code:
<br />
private void panel_MouseDown(object sender, MouseEventArgs e)<br />
{<br />
Panel region = (Panel)sender;<br />
<br />
xi = e.X;<br />
yi = e.Y;<br />
<br />
drag = true;<br />
}<br />
<br />
private void panel_MouseUp(object sender, MouseEventArgs e)<br />
{<br />
drag = false;<br />
}<br />
<br />
private void panel_MouseMove(object sender, MouseEventArgs e)<br />
{<br />
if (drag)<br />
{<br />
Panel region = (Panel)sender;<br />
<br />
region.Location = new Point((region.Left + (e.X - xi)), (region.Top + (e.Y - yi)));<br />
}<br />
}<br />
Basicly i think the problem is the diference between the coordinate system from the mouse and control
Other thing i dont understand is how does suspend/resume layout works as they weren't doing a thing.
Thx anyway,
Nuno
|
|
|
|
|
Use the Capture property of the control. That makes the control capture all mouse movement, even if you manage move the mouse fast enough to slip outside of the control:
private Point start;
private void movable_MouseDown(object sender, MouseEventArgs e) {
Control c = (Control)sender;
start = c.PointToScreen(e.Location);
c.Capture = true;
}
private void movable_MouseUp(object sender, MouseEventArgs e) {
Control c = (Control)sender;
c.Capture = false;
}
private void movable_MouseMove(object sender, MouseEventArgs e) {
Control c = (Control)sender;
if (c.Capture) {
Point mouse = c.PointToScreen(e.Location);
c.Left += mouse.X - start.X;
c.Top += mouse.Y - start.Y;
start = mouse;
}
}
Note: As this code uses the sender argument to reference the control, the code can be reused for the events of several controls that you want to be able to move.
sinosoidal wrote: Other thing i dont understand is how does suspend/resume layout works as they weren't doing a thing.
It's used for more complex controls, for example when you want to add a lot of items to a list without having the list redraw itself for every item.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi all,
If anybody could tell me that how to select text area or image on the viewer control(miDocView) of MODI using TextSelection property and ImageSelection property in c# .NET.
If you know,please let me know as soon as possible.
Thanks in advance.
|
|
|
|
|
Please let me know what should go in the second loop below.
Thanks
List<list<forward>> ForwardCurves = new List<list<forward>>();
foreach (List<forward> forwardCurve in ForwardCurves)
{
//another loop to go through the next collection...?
//????
foreach(List<forward> f in forwardCurve)
{
}
}
|
|
|
|
|
i don't understand what you are trying to do here.
Do you want to have a List of Lists of List?
put code in the second loop that does whatever you want done to each of the lists in fowardcurve.
Maybe if you explain what you are trying to do I can help more.
HTH
Russ
|
|
|
|
|
yes, to put code in the second loop that does whatever you want done to each of the lists in fowardcurve.
Thanks
|
|
|
|
|
Hello
I am writing a file. The text of file is not in English, but it can be in chinese, arabic, spanish etc language. Currently i am testing for chinese language. But when the file is written, i can not find the exact text i have written. I mean after writing the file, when i open the file, it dowsn't display me the original text i have sent to be written. I think there is some problem in writing that file. Can someone tell me how can i write a file in any other language other than english???
Regards
sAqIb
"Our scientific power has outrun our spiritual power. We have guided missiles and misguided men."
Dr. Martin Luther King Jr.
|
|
|
|
|
How are you opening the file? What utility are you using?
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Make sure you use Unicode when reading and writing the file. UTF-8 is typically used in files, but UTF-16 works as well and have the advantage of a mandatory Byte Order Mark identifying the encoding.
Unfortunately a lot of people still save with ANSI encodings which varies from system to system (due to ignorance I guess, but probably it did not help Microsoft named it the "Default" encoding which is an unfortunate name for something that is depricated).
|
|
|
|
|
Hello,
I have a FlowLayoutPanel, it has a scroll bar on the bottom. What I want to do, is when the user is trying to scroll, not to scroll until the user releases the scroll button. Sort of same functionality how it is in Outlook Contacts screen.
Thank you
|
|
|
|
|
Hi All,
I want to print A file with its format in my programe.
can any one help me.
merwa
|
|
|
|
|
Look at the PrintDocument component. This allows you to draw stuff using the Graphics object, just on paper rather than the screen.
|
|
|
|
|
Hi!!
I'm creating this aplication that uses crystal reports..
to bind data (after filling dataset) to report i'm using:
<br />
MyDataSet ds;<br />
...<br />
crDoc.Subreports[0].SetDataSource(ds);<br />
crDoc.Subreports[1].SetDataSource(ds);<br />
crDoc.Subreports[2].SetDataSource(ds);<br />
<br />
crViewer.ReportSource = crDoc; <br />
and then a database login prompt shows.
there are 4 textboxes to fill:
'Server Name' - Enabled = false, Text = "MyDataSet"
'Database' - Enabled = false, Text = ""
'Login ID' - Enabled = true, Text = ""
'Password' - Enabled = true, Text = ""
and whatever i input it returns 'logon failed. please try again'..
anybody had a problem like that??
is there any solution/workaround to this?!
thanks for any help
-- modified at 9:30 Wednesday 13th June, 2007
i forgot to add that this happens only in release mode - in debug mode everything works fine. and the prompt shows only in one report.. i've got two other and they work fine..
life is study!!!
|
|
|
|
|
Hi Friends..I have a ultrawebgrid..after selecting a row and pressing delete key in Keyboard.the selected row got deleted..I want to disable that option..Plz help e..
Warm Regards,
Rahul
|
|
|
|
|
Please don't multi-post, and this question would be better asked on the Infragistics forums.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
you can adjust the keys that the object uses by selecting the relevant keys in the option of the shortcut keys in the object properties.
|
|
|
|