|
Hi all,
I have a custom winforms control. I want to be able to use anchor/dock type functionality in the form which hosts it, to facilitate dynamic resizing. Only thing is, my control must be square (ie width==height) to render properly.
how can i force this to be the case?
Thanks
Jon
|
|
|
|
|
have you tried ensuring that Width and Height = Math.Min(Width, Height) in the Resize event? Not sure if that'll do what you want but its where I'd start.
Regards,
Rob Philpott.
|
|
|
|
|
You can't use dock and have the control retain its shape. What you're going to have to do is use anchor, and handle the form's resize event to modify the size and position of the control.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
You could host your control in a parent control. Dock the parent control, and in its resize handler do something like child.size = min( this.width, this.height ) (and recentre it in the parent if desired)
|
|
|
|
|
Hi ,
I need help in creating a program to send a mail using Microsoft Exchange server not SMTP. Previously I created a DTS package with a send mail task in it. It seemed to work properly in my local system where I had my MS oulook configured. But it failed in the server since it does not have a local profile configured.
If any one is able to answer to either of the above problem would be grateful.
Jack Sparrow
--------------------------------------
Defeat is not the worst of failures. Not to have tried is the true failure.
|
|
|
|
|
Hi all,
Can anyone tell me that how to fire drag drop event in richtext box in C#.net??
Thanks in advance
Lijo
|
|
|
|
|
Basically, you have to set AllowDrop property to true , and use DragEnter event and DragOver
Calin
|
|
|
|
|
But in .net 2.0 i am not able to find out drag drop and drag enter event for rich text box??so how can i get it??
Regards
Lijo
|
|
|
|
|
|
you are saying that the events are not browsable from the Properties, right?
Try by extending the RichTextBox .
Calin
|
|
|
|
|
Hi ,
I am new to windows application. so i dont have much idea about this.Can u please explain me how it can be done?
Regards
Lijo
|
|
|
|
|
Actually, you don't need to have the events in the properties window, you may handle the events like this:
public Form1()
{
InitializeComponent();
richTextBox1.DragDrop += new DragEventHandler(richTextBox1_DragDrop);
richTextBox1.DragEnter += new DragEventHandler(richTextBox1_DragEnter);
}
void richTextBox1_DragEnter(object sender, DragEventArgs e)
{
throw new Exception("The method or operation is not implemented.");
}
void richTextBox1_DragDrop(object sender, DragEventArgs e)
{
throw new Exception("The method or operation is not implemented.");
}
Calin
|
|
|
|
|
Thank you....
regards
Lijo
|
|
|
|
|
Hi all,
On the release mode only, when build the project I want to execute a bat file. That bat file do another process.
What I've try is add the bat file name as the command argument in project property as pre-build event command line.
But it not works for me. Can anyone comments on this.
Thanks you.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
|
Something like this,
if $(ConfigurationName) == Release yourbatchfile.bat
|
|
|
|
|
Actually I don;t want to run the project. Only in the build, compile, I want to run the .bat file.
I've set the properties on post-build event command line as follows.
call $(ProjectDir)build_help.bat
It calls the bat file correctly. But it's not execute. bat content like this.
echo compiling help documentation<br />
"C:\Program Files\HTML Help Workshop\hhc.exe" Help.hhp<br />
echo done.
error is,
Unable to open Help.hhp
But when I double click on the bat file it works fine.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Try specifying the file path for "Help.hhp", absolute path
or place "Help.php" in the release/debug folder(whichever you are currently building on)
|
|
|
|
|
Seems it's fine. But now the case is I've to place all html files and stuff in bin folder too.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
You can copy then back to where you want with a batch file
Did it not work with an absolute path ?
|
|
|
|
|
As I said earlier once the command is call $(ProjectDir)build_help.bat ask to add bat file into the bin folder.
If I added bat file into the bin, I have to change all paths.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Hi...
Pls help me to retrieve Image from a DataBase(SQL 2005).
|
|
|
|
|
This has been asked sssoooooo many time, try a search clickety[^]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Having been kicked out of the basement yet again to develop a little something in the "higher" level code I'm muddling around in the dark and trying to look bright doing it.
I need to create a service that will launch mulitple instances of an application (APP) and be able to have some interaction with each APP as well as the service itself (via a serperate application to be developed later - which will be mostly used to add/remove APPs).
Just to get the blood flowing, and something started on my desktop, I came up with this little mess...
Process[] p = new Process[portsAL.Count];
NamedPipeServerStream[] pipeServer = new NamedPipeServerStream[portsAL.Count];
for (int i = 0; i < portsAL.Count; i++)
{
p[i] = new Process();
p[i].StartInfo.FileName = appPath;
p[i].StartInfo.Arguments = portsAL[i].ToString();
p[i].Start();
pipeServer[i] = new NamedPipeServerStream("pipe" + portsAL[i].ToString(), PipeDirection.InOut);
pipeServer[i].WaitForConnection();
}
While that actually works (put in a bit-o-code into APP and each instance reported in on its assigned pipe) I will be the first to agree [admit] its not very elegant and I suspect its going to lead to my doing alot more work than my inheritently lazy nature will appreciate. Also, it became clear rather abruptly just how cumbersome it was going to become if I went much farther along these lines.
Soooo..... here I am humbly seeking the wisdom of my betters to give me a shove in the right direction.
---------------------------------------------
Help... I'm embedded and I can't get out!
If they don't get the basic research and learning skills down then they'll end up having a very hard life (Either that or they'll become managers) - Micheal P Butler
|
|
|
|
|
What about sockets? Old fashioned maybe, but you know where you are with a socket. Good for remote management etc. too.
Regards,
Rob Philpott.
|
|
|
|