Creating Custom Form Template - vb.net

I'm creating a vb.net project with over 20-30 forms. I want to apply same options for every form like "no border,backcolor,picturebox at left bottom etc.". and it takes much time to do these for ever form. Please tell me a shortcut :)
(I've thinked about creating one form and duplicating it.)

Creating Template Forms using Visual Inheritance
https://www.codeproject.com/Articles/7038/Creating-Template-Forms-using-Visual-Inheritance
[RESOLVED] Creating a Windows Form template/library?
http://www.vbforums.com/showthread.php?641019-RESOLVED-Creating-a-Windows-Form-template-library&s=1fb7d88423241485b8fff8e50ef97d04
Create your Form with the properties set then
File (Menu) | Export Template
Note: Links to other posts aren’t advised but there is a lot of content and didn’t want to just copy/paste, these could become dead links in the future mind.
You can create Project Templates and Item Template which can have code files, assets etc already there, it’s how File | New works.

Related

SharePoint 2010 and Editform.aspx

In one of my custom application user wants to keep EditForm.aspx open once list item is created and he can keep saving the same record without redirecting user to DisplayForm.aspx page.So what I'm doing after list item creation I'm loading EditForm.aspx again.
Now the problem is when form is opened in Edit mode and if existing field is modified that doesn't gets updated in the list item but if something new added to the field then it gets saved to the list. I believe it's postback issue but not sure how to pass latest form data upon save.
If this was my task, I would create a new application page that replaces the edit page on that list.
(You can use powershell / object model to set the url of the new / edit / display pages)
Ignoring the ribbon, the edit page is actually pretty simple. It shouldn't be too difficult to create a custom one, that has the submittal behavior you are interested in. Indeed, since you are keeping the exact same field names and input types, you may be able to simply inherit the default form in yours, and simply override the post call.
I suppose it might be possible instead for you to write some javascript to hijack the submit post of the default edit page, but this seems messy to me, and I probably wouldn't go that route.
If you don't need to complete this task today, I've been meaning to push to github some code I wrote a few months ago. That code is a custom aspx edit/new/display page that is extremely easy to customize / implement. I could forward you the link tonight when I get out of work.

Insert javascript code in a list form.

I have a list, and want to insert custom javascript code in a new form for this list (when form loaded). For example, when new form for this list is opened, I want to make some layout modifications for this form.
How it can be done? And how many ways exist to achieve this?
Thanks.
Upd: I ask about SharePoint list, and SharePoint list forms, I suppose you look at the tags of the question :).
You put tags for both SharePoint 2007 and 2010 and the methods are a bit different.
I agree with the previous post that with SP2010 you can simply use InfoPath designer for form design and do whatever you like to the look.
In SharePoint 2007, there are a couple ways incuding using SharePoint Designer, editing the form .aspx file, hiding the out of the box form and inserting a custom form which you will then be able to edit. You can also add in JavaScript code there as well.
My preferred method if you are just making some visual modifications is always JQuery which you can add in to a content editor and you can look for the particular tags surrounding rows or columns and attach to them and make your changes.
I think your question and tags need further clarification to get an articulate answer from anyone that will actually help you.
You can edit the layout using InfoPath 2010 like described here:
http://office.microsoft.com/en-us/sharepoint-designer-help/edit-list-forms-using-infopath-2010-in-sharepoint-designer-HA101631624.aspx
If you've got the SP2010 Foundation or SP2007 version, you can create custom list forms using SP Designer which gives you the option to do whatever you like since those are .aspx files.
http://office.microsoft.com/en-us/sharepoint-designer-help/create-a-custom-list-form-HA010119111.aspx
You can also edit the aspx List form in SP designer. To add Javascript or jQuery you should create a form for New in PS design then edit in Advanced mode to insert your Javascript in the proper place. There are many tutorials on the Web that talk about this... Also, you can add content editor webparts to the new aspx page where you can insert your Javascript or jQuery.

Referencing user controls that are contained within the same VB.NET project

I do apologize if this post is a duplicate, but I haven't found anything similar when I searched.
I'm fairly new to VB.NET and I'm currently playing around with user controls, figuring out good programming practices. As far as I understand, to create and use a UserControl, I need to create a project with the UserControl in it, then build the project and use that DLL (add it to Toolbox or otherwise).
My question is this: Is there a way a have a project (a Form with a bunch of things on it) that contains a UserControl written in a *.vb file inside that same Project? If you do that, the DLL (in my case) never gets produced, possibly because the UserControl is never used and building it is simply omitted. Is it perhaps a bad practice to do that altogether? It simply makes sense to me to keep a UserControl as a part of the Project that uniquely uses it. Is there a reason not to do that?
Thanks in advance! = )
SOLUTION:
Visual Studio does not automatically include your own controls to the toolbox by default! In order to change that, go to Tools>Options>Windows Form Designer>General and set AutoToolboxPopulate to True. When you build your project next time, your new Control will appear in your Toolbox.
It's a perfectly valid design decision to include a UserControl in a WinForm or WPF project that uses it. If you do this then VS will not create a DLL for the UserControl; instead the UserControl will be built into the assembly your project is producing.
If you did want to reuse a UserControl in multiple projects then you would want to create separate project that generates a DLL that can be reused.

VB.NET - Duplicate existing form in FOR loop

Hey, I'm building a code editor app in VB.NET (Framework 4.0) and it opens all ".por" files into individual forms consisting of a MenuBar and TextBox (multi-line).
Currently I have 20 forms (all duplicates of the first on I designed) and if there are say 4 ".por" files in a directory, the first four will open up while the others hide.
I think it would be far more efficient by coding a new form For each item in form1's ListView...but I want the next so many to be a copy of the first form I designed since I spent a good bit on it.
Thanks in advance!
I decided to use tabs instead.
It wasn't difficult, the problem was I didn't know how to use a form I couldn't see.
By sticking to tabs and making a huge IF statement, simply making a new tab for each new file, and I'm getting used to using controls which haven't actually been created with the designer.
Just passing through a wall here...

Modify Outlook Form Code programmatically

How to programmatically get at outlook form code?
To clarify from one of the comments - Outlook form code is the VBA code that sits behind the form - it can be customised in the form design mode to do pretty much what the user needs to do.
Our product relies heavily on form code, but certain bits of it need to be customised per installation. We are looking for some way to automate this process, as we have upwards of 30 custom forms it is a tedious process to do it manually...:-)
Use a configuration file (use ReadFile etc)
Or put the configuration information in a "special" item in a public shared folder
You can also use the "Office Profile Wizard" to package it up with a custom vba module iwht the configuration information in that
You should never write out customised code, that is a big can of worms