How to make the "PageSetting" dialogbox of Notepad.exe in .NET app? - page-setup

I Want make a PageSetting dialogbox by .NET like this in Notepad.exe:
I write the code use System.Windows.Forms.PageSetupDialog, it just look like this:
I tried the PAGESETUPDLG.lpPageSetupTemplateName with Win32 API, it works.
But the UI is too ugly.
How can I use only the .net class to make the dialogbox likes in Notepad.exe?

Thanks to #Hans Passant.
I got an infomation from your answeer.
then I found the page is very helpful to the question.
The link

Related

PowerPoint - how to run a macro automatically?

I'd like to run a macro that sets the zoom to 100%, something like Windows(1).View.Zoom = 100, every time ANY file is opened in PowerPoint. The files are already created, so using a template to set the zoom is not possible. How can I do this?
There isn't really a way (that I am aware of) to do this through a macro or powerpoint add-in. You might be able to do it using a custom web add-in but I don't have enough experience with that to provide an example.
After looking around there have been a few success stories. One of which is creating a custom UI element and then adding an onLoad hook to that.
Here is the thread.
Here is a link to the Custom UI Editor Tool However I had no luck in getting it to work. I believe (This is only my theory) that it is not compatible with the latest .NET framework.
If you do end up trying to do this, here is a link to the xml formatting documentation for UI elements. And a link to a little tutorial related to this.
Sorry I couldn't be of more help. This should at least get you started. If anyone else has a simpler way I would love to know as well.

Image/Picture on a messagebox C#

Is it possible to add a picture to a messagebox in C# besides the customized buttons?
or
How do I put the picture I want as a custom Icon?
It is not possible.
Instead you can use a Form to show the image. You message box will be just like any other form in your application.
It is useful to have such type of facility while coding with C#, but reality is it is not as relevant as we think.
a good practice is to use Forms instead of putting things in MessageBox.
Try it I hope it helps !!

TextBox in MessageBox in Windows Phone 7

Is it possible to insert a TextBox for the user to input text on top of a MessageBox in Windows Phone 7?
Thanks.
No - it isn't
But the "Input Prompt" in http://coding4fun.codeplex.com/ might help you. See the overview at http://www.windowsphonegeek.com/articles/Coding4Fun-Toolkit-for-WP7-Overview-and-Getting-Started
I've used the "Input Prompt" for a situation similar to this and I had no problems. This should work as suggested by Stuart. Also Stuart is right that this is NOT possible at this time.
You might also want to check out Telerik controls, RadWindow for WP7 to be specific should address the problem nicely. Only thing is that these are commercial so you'll have to purchase a license.
But if you want to create your own from scratch I watched a video, "Creating a Custom Popup", on silverlight.net that can get you started nicely. Basically it gives you the "pop up" and you can add any other controls you need inside of it.
Bear in mind all these solutions can be styled and positioned to "imitate" the look and feel of a messagebox like you wanted. Hope this helps.
This is not possible in native MessageBox. You can try Coding4Fun library as mentioned before.
An alternative solution is the InputPrompt which can be found in Telerik library (you will have to pay for this one though).

mvc html.serialize to store model in view

Can anyone tell me what happened to the Html.Serialize function mentioned in the url below.
It's not recognized when I try and use it in a MVC2 web app within Visual Studio 2010.
http://weblogs.asp.net/shijuvarghese/archive/2010/03/06/persisting-model-state-in-asp-net-mvc-using-html-serialize.aspx
EDIT - I'm using visual studio 2010 which comes with mvc2 'built in' when i try and use Html.serialize on a view or partial view it's not appearing in intellisense. Am i missing a reference or something?
It hasn't gone anywhere. It is right there, wherever you are able to use the html extensions. Eg, Views, PartialViews.
For example:
<%= Html.Serialize("wizardData", Model)%>
Are you trying to use it in a controller? To use it as shown in the article you quote, you need to use it in a view.
You see, we really don't know because you haven't given us any detail to work with. Show us some code, and we will move your earth. Well, try to anyway.
I see you are new, so when asking questions, try to give as much detail as possible. You can edit your post, just mark out what you have done. The more context we get, the more we can help.
I found out why! I was having similar problems too.
You need to download ASP.NET 2 Futures and use the DLLs provided there instead of the usual Mvc DLL.
It is implemented in SerializationExtensions class.
It's in the MVCFutures assembly and not part of the out the box MVC framework. You will need to add the package via nuget or manual download and then add a using/imports statement to Microsoft.Web.Mvc before you can use it in your view.

How to create quick-entry dialog with system-wide shortcut?

I really like how Things gives us ability to capture todos without switching to the app. How to do this? I can't find any relevant code with google. Any ideas, urls or maybe code snippets?
I learned about global hotkeys from the example on this website here.
I'm not familiar with Things, but it sounds like you're describing a Service. Services live in the application menu under Services.
TextEdit.app provides a "New Window Using Selection" service, for example.

Resources