|
If you want to see all textbox which added to the form.then you can use the below mentioned code block
private void button1_Click(object sender, System.EventArgs e)
{
Txtbox= new TextBox();
this.Txtbox.Location = new System.Drawing.Point(locx, locy);
Txtbox.Width = 100;
this.Controls.Add(Txtbox);
locx=Txtbox.Location.X;
locy=Txtbox.Location.Y+30;
}
//here i have only one button on my form. On button click i am dynamically creating
//textbox control and adding to the control collection of form.
//before getting into code you have to declare one private datamember of the type textbox and two integer variables that will help you to keep the location unique.
so you can avoid overlapping.
private System.Windows.Forms.TextBox Txtbox;
private int locx=20,locy=30;
hope this will avoid from overlapping
Sreejith S S Nair
|
|
|
|
|
If I want to use special cursor image other than the default list given in .Net environment, how to add new image to the list of available images.
|
|
|
|
|
You can not in the default list.
After creating a cursor you use it through your own class.
|
|
|
|
|
On desigh time you have only limited number of cursors.
but on run time you can change you cursor of form or any control which is avilable in your application.
where you want to write code is up to you.
eg: if you want to change the cursor of the form on form_load or button click event , what you need to do is simply write this code.
this.Cursor=new Cursor("C:\\DRAGPICT.CUR");
//here i am changing cursor of my form.
// if you want to change the default cursor of any control. then follow this
this.button.Cursor=new cursor("C:\\newcursor.cur");
hope this will help you
Sreejith S S Nair
|
|
|
|
|
Hi,
I would like to save files into the "Temporary Internet Files" folder.
How do you set the path when the user is different each time?
string path = "C:\\Documents and Settings\\<user>\\Local Settings\\Temporary Internet Files\\";
thanks,
Ron
|
|
|
|
|
You really shouldn't do that because the folder has a special purpose that is not under your app's control, and can be wiped out without you knowing about it.
But, if you must...
You can use the Environment.GetFolderPath method to return the full path to the Temporary Internet Files folder for the logged in user:
string tempInternetFilesFolderPath
tempInternetFilesFolderPath=Environment.GetFolderPath(Environment.SpecialFolder.InternetCache);
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Dave,
Ya... I'm not sure. I'm trying to emulate the feature "Send" in WordPad (e-mail your document). I noticed that WordPad is saving a copy of the doc in the folder OLK63B in Temporary Internet Files (this file is used for the attachment). I guessing they're doing this so the file is flushed eventually? I can't actually see this folder "OLK63B" when I use Windows Explorer though. They must be creating a copy file so your not having to save the modifications (if any) before you send. Maybe I should just (via my code) create a copy file (append with the word "COPY") and delete the file after sending. What do you think?
Ron
|
|
|
|
|
That will work. You could even just create the file in <SystemRoot>\Temp with the original filename, attach the file to the email message, send the message off, then delete the temp file. I'd use the original filename (unmodified) so the user at the other end can save the file with the same name it was created with.
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks Dave,
I'll do just that...
I'm new to programming, so I'm not sure just the best way to delay the delete of the file (so that Outlook has time to load/place/send the attachment). I could use a MessageBox (Click OK to delete attachment file), but that seems cheesy. Can you use code to tell when any running application closes?
Ron
|
|
|
|
|
You could use the Process class to monitor the process list for the close, but that would involve either launching a seperate thread to poll the process list every so often, or blocking your app and waiting for the Outlook message window to close. Also, the problem with that is if the user is not using outlook, but a different email package the process will be different.
There is no easy way to do this except to NOT make a copy of the file and just send the original file and not worry about monitoring anything and deleting files.
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
"just send the original file and not worry about monitoring anything and deleting files"
Yes this is the way I have it now... force the user to save the file first(if not already saved), and to also save the file if modified. I was thinking that some users say not want to save the modifications to the original file (just have the modifications in the e-mail file).
Maybe I could create a temp folder in the program folder and have it nuked on the app. close event. Thanks for all your help!
Ron
|
|
|
|
|
myNameIsRon wrote:
Maybe I could create a temp folder in the program folder
Not a good idea. The Program Files folder can be ReadOnly for some users.
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
When the mouse is moved over PrintPreviewControl, how to change the cursor only when it is on the document that is displayed in the control. It should remain at default state outside the document. When two pages are displayed in the PrintPreviewControl, how to identify which page is clicked?
Also, how to display the vertical scroll bar of PrintPreviewControl programatically?
can we sense its up/down click events?
|
|
|
|
|
Please be patient and don't post the same question over and over again.
See your previous post. You'll find that the PrintPreviewControl doesn't expose any of this functionality.
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
sorry for the trouble.
but as i was requesting help on
how to display the vertical scroll bar of PrintPreviewControl programatically?
can we sense its up/down click events?
I thought of raising old questions too, as I am really facing hard time. I want to do it my self, though I am a new learner.
In case of finding the co-ordinates of the page image , suggest me the possible ways please.
regards
|
|
|
|
|
sachinkalse wrote:
I am really facing hard time. I want to do it my self, though I am a new learner.
If your deadline is that close, try and find a 3rd party component that will expose this functionality because the PrintPreviewControl will not do and writing your own component will be exceedingly difficult for a beginner. To expose this kind of functionality, you would have to write your own print preview control from scratch. Like I said, NONE of the functionality you are looking for is exposed by the PrintPreviewControl.
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
yes, i do have time, need a little bit of guidance.
regards
|
|
|
|
|
That's not what your last post said, but anyway...
Look into using the PreviewPrintController class. There are no examples of how to use this class to build your own PrintPreviewControl, but that what it's used for.
Search the Web for PreviewPrintControl and you'll see what I mean.
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I am using the Webbrowser control's print preview in a C# application to generate report. I am using the EXecWB method to generate it.
Does anybody know how to make that Print Preview control modal.
When the Print preview is opened i am able to go to the application and work on it. If Any body knows the solution send it to me ASAp
|
|
|
|
|
(I THINK!) Since your app didn't actually create the dialog window, a control your app owns did, no, there is no way to open it modal.
As a thought experiment... You might be able to get away with finding the window and getting it's handle (requires calls to Win32API), and then calling the Win32 API functions GetWindowPos and SetWindowPos with the SWP_NOZORDER flag to set that window to maintain its status as the topmost window on the desktop and keep it there. But this will not prevent the user from switching to another task...
(As a side to this little experiment, setting a window modal state can only be done on window creation. You can't create a window, then go back and change it's modal state later.)
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I am developing an application like MS Spy.
How can i change the mouse pointer of the entire desktop from my c# application.
The mouse pointer should behave like the Finder Tool in the Microsoft Spy.
Kindly give some idea.
Thanks in advance
Shaju Mathew
|
|
|
|
|
chnage the cursor property of form or any control.
Sreejith S S Nair
|
|
|
|
|
Thanks Sreejith..
But that didnot solve my problem Because i want to change the entire desktop's cursor, ie the cursor of all applications. Not just my applications or forms cursor
Thanks Shaju
|
|
|
|
|
give me a clear picture of your requrement.
Sreejith S S Nair
|
|
|
|
|
Hai, Sreejith
As u told if i change the Cursor property of my Form or control, it will only change the cursor of my form. ie if i move the mouse out of my applications area then the cursor will be the cursor of the application below the cursor. But i want to have my cursor for the entire windows opened.
You can see this behaviour of cursor in MS Spy.
Thanks
Shaju
|
|
|
|