How do I move items freely in Visual Studio 2019? - c#

I'm new to editing web pages on ASP.NET webforms and is currently exploring, whenever I add items, they are always added on top left and I can't move it to center, I just want my button to be at center.
I'll use my website for school purposes only and most likely will be disposed after some 2 years, that's why I used webforms instead of MVC because this is a short-lived project
How do I move it freely?

I'm not too sure what you mean, however, I will try and provide a solution.
Unfortunately, because of a bug, the menu is disabled for and based controls. To enable the menu, add style=”display:block” to labels or hyperlinks. This will be fixed in the next service pack. You can then use the Position dialog to set positioning mode:
https://devblogs.microsoft.com/aspnet/absolute-and-relative-positioning-in-visual-web-developer-2008-designer/
this is a good website to help you.

Go to .aspx Source page and modify the control's style like this:
style="position:absolute; top: ...; left: ...;"
Now you can drag it to anywhere you want. But setting the position of the control programmatically is a better choice.

Related

Dynamic form with resizing in C# .net

As a learning project in C# .net I am re-creating a Gnome 3 plugin for seeing who of the streamers you follow on Twitch is live. I have the settings form done, I am now working on the interface that is viewed from a click on the taskbar.
This is a rough image of what I want the interface to look like. When two or more streamers are live the interface would add another block and resize the form vertically similar to the menu for selecting a Wifi network in Windows.
What would be the best way for me to complete this?
My current thought is to maybe create a custom control and just place those inside a FlowLayoutPanel with some kind of code to change the vertical size of the form to match the added entries. Maybe this can be done without a custom control and be done with code inside a FlowLayoutPanel? I'm not too sure.
Ideally I would also have a click event in the panel for each streamer so I could then open a browser to their channel. A slight highlight would also be a plus (maybe change the background colour based on mouse hover).
Thanks in advance for any suggestions!

How to enable horizontal drag-drop in asp.net webforms?

I am using VS 2013 Professional. I am trying to make a website in ASP.net Web forms (C#). While using the web designer in visual studio, I cannot drag and drop elements vertically. In other words, no matter where I drop the element, it appears at the start of the line. I've done research and this appears to be a common problem. However, still no solution found. How do I enable FULL drag and drop control, not just vertically ?
You can move Controls freely in VS 2013 by:
Remove all current controls
Go to Tools > Options > Html Designer > CSS Styling > Change positioning to absolute for controls added using Toolbox, paste or drag and drop.
Now drag and drop a new control in page.
* 4. Click on the Label that appear above the control (asp:button#Button1 for instance) and move it any where you want.
A friendly piece of advice:
But it seems that you aren't familiar with web designing, this way is not recommended, it's not a WindowsForm, you deal with wide rang of browsers and resolutions.
In fact when you can move controls freely, you set style="position: absolute".
When your web page is finished, then open it and resize your browser, then you will completely understand what I'm saying.
If you want to design a real web page, you should go for CSS and do a little search about it.

WPF applacation window screen shot displayed on button

i have create a few WPF applications in visual studio, and now i would like to create a final application to run all of the created apps in the final application. i would like to know how i can create a layout that displays the apps that are running inside the final app as buttons that can be clicked and cause the app to expand and allow the user to work on that app and then when finished return back to the final app and see the other apps to choose from. I imagine it would look like a Google chrome blank page that allows you see your familiar webpages and click on them to load them up. Any help or advice on what i should focus on to implement this would be much appreciated.
Thank you for taking the time to read over this.
Consider using a VisualBrush this takes other WPF UI (your "apps") and uses their UI as a brush for another UI element.
Raj Kumar has a simple article called Visual Brush in WPF for details.
The bit you probably want is at the bottom where he shows you rendering a controls content in another control. The magic being binding the controls visual to the element name whos UI it should render.

Left Menu Tabs Control in Windows Forms Application How can i get it? Its available in current controls?

i am building a C# application, i have explored its all controls but i cant find the left menu style which i usually see in software applications for example visual studio, i am attaching the image of what i need.
Please let me know how can i use it in my forms. I have used a tab menu control in visual studio, but it is not what i required, its tabs are vertical, but i want the exact like i shown in attachment. I think it requires some reference to add.
I don't think that control is available, which means you would have to make one yourself. Here is a link from someone that made one. I haven't tried it: Visual Studios "My Project" Tab Control
There is no such a control in the ToolBox by default. But you could create one for you.
Creat a user controller.
Added a SplitContainer and set Dock.Fill.
Add a FlowLayoutPanel to the Left panel. Add buttons or labels as you wish and implement the click event.

ASP.NET Menu control changing position after postback

I am currently testing a menu in ASP.NET I've recently made using asp:menu control.
The menu is just as I want it to be right now, but whenever there is a postback that updates the whole page, it moves a little downwards (only once, a second postback won't move it a little bit more).
It's not CSS - > I've removed all CSS from this menu)
It's not any property -> I've commented out everything related to customizing the menu
It's not any other element above it enlarging -> I've specially put it inside a table, in which the only content is the asp:menu control
It moves a lot downwards in IE6, a little in IE8, and it doesn't move at all in Firefox 4.
What could I do ? Are there any alternatives ? Is there any property I can use, or any outer element I could put it inside in order for it to stay still ?
And yes, every single machine this is going to run in is using Internet Explorer. The nightmare of any web developer.
---[update]-----
I've built a menu in a separate project, and the effect wasn't there! I've copied the exact same files into my project, and ran it, and the issue was there.
Could it be a difference in the asp.net version ?
Did you check using IE web developer toolbar to see what's the html looks like in that area before and after the postback? It seems more like a browser issue so the toolbar would give you details as what is coming in the gap or may be what's pushing it down.
If the app is in asp.net 4.0, look at the source code of the page after it renders the first time, and then after the postback. Make sure it renders as divs on both or tables on both.
I currently have a similar issue where my menu "spreads out" on the postback. Before the postback, it renders divs. After the postback, it renders tables.
There is specifically a property on the menu "RenderingMode" which is suppose to control this, but it is not working for me.
I had the same problem. My navigation menu sits in an UpdatePanel, and I changed the UpdateMode from Always to Conditional - problem solved. This was in my master page.

Categories