|
Thanks, that helps!
|
|
|
|
|
you're welcome.
|
|
|
|
|
when you use the icon at the first time.
it had been imported into .resx file.
so you should open the file, and delete the icon.
(you should look up toolbar's background-Image Property,
may be you will see the icon)
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 22:02pm.
|
|
|
|
|
I have been wrestling with a problem for about four days now, and quite honestly I think it's winning. I'm down by two falls to one at the moment.
Since song parodies were mentioned in The Lounge recently, I thought I'd have a go.
My application won't compile
I've searched the thing all over the place
Googled till I was black in the face
I'm a big disgrace t' the Programmer race
My Application won't compile
You see what it's done, it's reduced me to a gibbering wreck.
Here's the problem.
I have a generic class, to save you reading through loads of code, for this explanation pretend that it is a Stack<T> , since the result is the same.
Now I want to create a Control StackVisualizer that can show a graphical representation of any Stack<T> . You know a set of vertically aligned boxes representing the items in the Stack<T> , so that you can see what happens with Push and Pop etc.
public partial class StackVisualizer : UserControl
{
private Stack<T> workingStack = null;
..................
..................
..................
..................
}
That doesn't work, because T is not known at compile time.
OK so lets try:
public partial class StackVisualizer<T> : UserControl where T : IEnumerable<T>
{
private Stack<T> workingStack = null;
..................
..................
..................
..................
}
Now this works, but StackVisualizer is no longer a visual control. I can put it on a Form and set its properties etc. but I have to do it in code, I cannot do it in the Designer.
Does anybody have any ideas?
Plzzzzzzzzzzz give me teh codezzzzzzzzzzzzzzzzzz!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
modified on Wednesday, September 9, 2009 2:13 PM
|
|
|
|
|
We cannot create Regions within a Function then what is the alternate to make group / divisions like regions within a body of a function
is their anything or not
Best Of Regards,
SOFTDEV
Sad like books with torn pages, sad like unfinished stories ...
|
|
|
|
|
softdev_sup wrote: We cannot create Regions within a Function
If it is C# you can.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Hi everybody,
I have an issue with Windows Forms:
I created a Windows Form and docked a picture box to fill the entire form, but the problem I have is that the picture box's size change only when either "Width" and "Height" properties of the Form (or both of them) are increasing and in fact, if I resize the form so that it becomes smaller (both in Width and Height) the picture box's size wouldn't change.
To test this, I tried to update the Text property of the form in the Form's Paint event to reflect the picture box's Size property and when I'm making the Form smaller, neither Width nor the Height of the picture box is changing, any ideas?
|
|
|
|
|
Do you have the SizeMode property of the PictureBox set to AutoSize ?
If that is so, could you please describe what effect, you are trying to achieve, so that people can suggest workarounds/alternative strategies.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thank you for your reply:
Firstly, the picture box's SizeMode property determines how the size changes according to the size of the picture being shown in the picture box.
Secondly, I want to achieve a condition in which resizing the Form ALWAYS causes the picture box's size to change even when both Width and Height properties of the form are decreasing; and in fact, as soon as every one of them begins to increase, the picture box's size is also changed.
|
|
|
|
|
I'm sorry that I have taken so long to answer your post.
However, you did not answer my first question.
farzadmf wrote: Firstly, the picture box's SizeMode property determines how the size changes according to the size of the picture being shown in the picture box.
I know this already, I asked what you had SizeMode set to in your application.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
SizeMode is set to Normal, but I tried with AutoSize but it didn't make any difference.
|
|
|
|
|
This is very odd. I have never noticed this behaviour before.
I had thought that there might be a problem if SizeMode was set to AutoSize , because of some strange conflict between it and the Dock.Fill property.
But, as you say, it happens with SizeMode.Normal too. I even tried Dock.None with Anchor set to Top, Left, Bottom, Right , but it was exactly the same.
I am at a loss.
There are two Articles here on CP that (supposedly) have PictureBox functionality without actually using a PictureBox. In case they are of help in your situation, they are:
C# Scrollable Picturebox Custom Control[^]
and
A Zoomable and Scrollable PictureBox[^].
When people post here asking for advice on PictureBox problems, I usually tell them not to use a PictureBox, as it is an awful control. You have given me an extra bullet to use.
Between the PictureBox and ImageList, Microsoft don't seem to be very good with images, do they?
Sorry not to be able to offer more help.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Don't mind please. It's OK.
Anyway thank you very very much for your concern. I will surely check the controls you mentioned.
Thank you again.
|
|
|
|
|
I'm not sure that you are correct.
Simple Form, PictureBox.
public Form1()
{
InitializeComponent();
this.Form1_ResizeEnd(null, EventArgs.Empty);
}
private void Form1_ResizeEnd(object sender, EventArgs e)
{
this.Text = string.Format("Form1 [{0}, {1}] - {2}", this.pictureBox1.Width, this.pictureBox1.Height, this.pictureBox1.Dock);
}
Connect the ResizeEnd event of the Form to the handler above.
All now appears to be hunky-dory.
What do you think?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I've tried your example. I have one form and put one picture box inside. I've only set Dock property of the picture box to "Fill" and everything was working fine. Forget about showing picture box size, in the text property of the form. Set Dock = Fill, and just to see that it is resizing, set BackgroundColor of the picture box to some color and test it.
|
|
|
|
|
Yes, you are right; if you set the BackgroundColor and make the Form smaller, you notice no difference because there is only one solid color, BUT imagine a situation where you have a picture or something being displayed in the picture box, if you make the Form smaller and the picture box isn't resized accordingly, some parts of the image would not be visible.
|
|
|
|
|
Hey there,
if you change the form's or any controll's size to smaller, i guess it won't repaint, but there is a possibility to tell the form/controll to do so:
public ExampleForm()
{
this.SetStyle(ControlStyles.ControlStyles, true);
}
hope this helps!
hack the planet
|
|
|
|
|
Thanks, I will try that and let you know.
|
|
|
|
|
Hello,
How to show Message/Notification from windows service.
When i use MsgBox("Hi") it is throwing below error ->
Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
Please Help.
Thanks,
Sh
|
|
|
|
|
Well the diagnostic information seems to have given you the answer. Showing a MessageBox, or any kind of Modal Dialog from a service is a bad idea as it means the service is stalled until someone answers the message. Most services are designed to post their messages to some form of log file unless they encounter a catastrophic error.
|
|
|
|
|
Thanks Richard,
I am developing custom MessageBox. When i call it from winservice it is thrwoing error. It says set servicenotification.
Richard, How to set "ServiceNotification" propert of custom messagebox.
Thanks
|
|
|
|
|
Try here for information on how this may be achieved.
|
|
|
|
|
Thanks Richard.
But the article is for standerd message box. I have created my own message box (Form), for which i need to set either "ServiceNotification" or "DefaultDesktopOnly".
I am not able to find, how to set those properties. Please help me.
Thanks
|
|
|
|
|
Your custom MessageBox should inherit from System.Windows.Forms.MessageBox and will then have access to the standard properties and messages. This may help.
|
|
|
|
|
Hi,
Any anybody help me how to send emegency message to all the systems connected in network.
(rather then "net send" command).
My idea is : When a user clicks a special key, windows application(t + # or ...) sends a file to server(crates a XML file).Other systems will keep watch the server file, if file exist then read the file and show the message. Is this a good practice? If any any other ideas please help.
Thanks,
Sh
|
|
|
|