winforms custom control moves when compiling [closed] - c#

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I have a winforms app I align the controls so that the look like picture 1. When I compile, a custom control resizes and repositions itself which is an undesirable effect. How can I stop this from happening. Autosize is set to false on everything.
Before compile: Correct.
After compile: Incorrect.
The picture is misleading. The form stays the same dimensions. It's the custom control that is changing size.

I had the exact same problem, controls resizing itself to the size of even 0,0 after every rebuild, wich got quite annoying after a while.
After searching through SO i found the solution in Rich his reply on a question similair to this: Click here
Basicly, when you set your Form's Autoscale property to None, this problem will dissapear.
Enjoy :)

Check the Anchor property of the textbox or label in the custom control

Related

How to change background color of selected item in LongListSelecter? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
I'm new to the windows phone development, and I'm now developing a windows phone 8 application.
Would you please tell me that in WPF LongListSelecter, how to change the background color of the selected item?
Better to display the code.
Thank you!
You want to change the background color or text color of selected item?
If you want to change the color of selected item, you need to implement INotifyPropertyChanged on the viewmodel and call RaisePropertyChanged event.
The following links are useful tutorials for your learning.
Highlight a selected item in the LongListSelector on WP8
LongListSelector in depth | Part1: Visual structure and API
You can use converter to set the selection color of the selected Item or you can use Blend to change the color via XAML

How to create a Google-like Calendar with existing components of WinForms [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I would like to create a calendar, but I don't want to create a new calendar component (btw because I don't know how to). I only would like to use existing components provided by the basic winforms technology (e.g. textbox, picturebox, etc). So, I was wondering what could be the best way to create an easy-to-understand calendar from those components, just like e.g. Google Calendar. It doesn't have to be that complex. It should only be able to handle coincident times. And different background colors for different texts e.g.
I don't require exact answers. Only suggestions is enough. Thank you.
Panels, lots of panels:
7x5 grid (days of the month)
Headers (days) The location of the days stay the same.
Labeling within the panel.
Labeling for event linked to new form. - you can use the ColorDialog to select text/icon colour (icon: Alt+7 - •)
I'm not sure what you want, but it is possible to do it and make a good looking calender.
You could use picture boxes and simply use paint/paint.net/photoshop/gimp to make the days/grid.
Good luck.

Creating a scoreboard in windows form application [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Hello I am doing this project where I have to make a quiz with 50 questions and since I'm very new to programming overall, what is some way that I could make it so that when the right radiobutton is checked and the Next button is pressed add 1 to the score and then at the end show your total score.
Give it a shot, this isn't a difficult but if you're totally lost and looking for a bit of a push...
Create an empty form.
Place some some controls on the empty form the way resembling the way you want it to look.
Then add a click event handler to the next button.
Test to see which radio button is on and then increment the score if it is the correct one.

How to replace the content on my asp.net page at the drop down selection [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
There are 2 types of users for my page.
1. visitor
2. Registered Member.
Login form for these two are different.
How do I present two forms. I think a drop down selection for member/visitor might work. But How?
I am new to programming. Please help.
If I disable the unnecessary controls for visitor, after drop down selection. then place it takes is much.
i just want to replace the whole form with new one.. on drop down selection. is that possible on the same page. Without navigating. and how?
You will have to place content of page in two different panels.
On changing index of dropdown you will have to set its visibility to true or false as you want according to content you want to show.
panel1.visible=true;
panel2.visible=false;
You can use Asp.net inbuilt login control. This provides you the flexibility to show the different stuff for anonymous and logged in user. For this there's a LoginView contorol available.
see the documentation : http://msdn.microsoft.com/en-us/library/ms178329(v=vs.100).aspx

Paint application in visual C# [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
I have created a simple paint application in VC# 2008 with the help of a YouTube video. Its code is as here:
http://paste.pocoo.org/show/268704/
The problem with the code is that if I draw something in the picturebox, minimize the application, and thn maximize it, whatever I had drawn, disappears. The picturebox becomes clear. Why is it so? Plz help me.
You should be doing your painting during the Paint event. This event completely redraws the image. So when you un-minimize the application, the image is redrawn and you don't do anything.
Your application needs to store information about what has been drawn so that it can be redrawn. This is an example of the Model-View-Controller model. The PictureBox is the viewer, the stored information is the model and mouse event listeners will be part of the controller that can make alterations to the model.

Categories