|
I want to place a button on my form such that it appears to be rotated counter-clockwise 90 degrees. This means that the text is rotated as well, not just stacked vertically, which could be accomplished by simply setting the button size to be tall and narrow.
Any pointers on how to do this would be greatly appreciated.
Thanks,
Dave
|
|
|
|
|
Hi,
I have a couple of Region objects which I want to draw the outline of on top of a picture which resides inside a picture box.
In the event handler for the picture box I perform the following code:
Graphics g = e.Graphics;
foreach (Region region in regions)
{
IntPtr hdc = g.GetHdc();
IntPtr hBrush = CreateSolidBrush(ColorTranslator.ToOle(Color.Black));
FrameRgn(hdc, region.GetHrgn(g), hBrush, 1, 1);
DeleteObject(hBrush);
e.Graphics.ReleaseHdc(hdc);
}
When calling FrameRgn I receive the following error message:
'System.InvalidOperationException'
The object is currently in use elsewhere.
Any help would be greatly appreciated!
|
|
|
|
|
Hi.
I have a program that reads a database and displays its graphics into a CScrollView Instance. To do that it reads records from the database and creates a small metafile for each of it. Finaly, when all those metafiles are created it replays them over the view and displays those that are part of the visible (on screen) window.
I want to create that view invisible (not on the screen) and using the same functions I would like to create all those metafiles. Then rather than replaying them on the display I would like to save them in the disk as EMF.
So far I manage to create the EMF and to replay over it the metafiles. However, I am always getting a part of my image in the saved file and not the whole image (wich be larger than the screen). I do not display the view on the screen thus the CGetClientBox CGetClipBox functions return a zero size rectangle. I 've tried to use functions to manipulate the window extend and the viewport but I am not sure that I understand them.
Can some explain to me what are window origin/extend versus viewport ones? And how can I affect the size of a disk saved MetaFiles?
Thanks a lot
Dimitris
|
|
|
|
|
I've got the following problem: I have a DLL written in C++, that exports a function. That function basically puts a very simple CDialog object on the screen (either modal or unmodal).
I have a very simple forms-based C# program that uses this DLL to call the exported function. Everything works OK.
Now, I add a custom control in the CDIalog-derived class, in C++, using an OCX that was developed by another company. When having this OCX, the C# code calls the exported function, but the dialog is not shown.
If needed, I can provide the code.
Any ideas why I have this problem?
|
|
|
|
|
There is many things in the design of the .NET type system
I do not understand why it should be like that:
- Why are we not allowed to provide parameterless constructors
for value types? (I find it a large limitation, since I sometimes
need defaults/initialization other than the process provides)/li>
- Why is the ValueType derived from Object?
- Since the derivation of ValueType from Object, makes it a class why boxing?
- Why is "ValueTypeArray" not provided instead of just Array for everything?
- Why is there no common base ValueType for numerics/numbers?
I recently found myself writing a class like,
public class TestClass
{
private ValueType m_valueMax;
public TestClass(ValueType value)
{
m_valueMax = value;
}
public ValueType Value
{
get
{
return m_valueMax;
}
}
}
instead of
public class TestClass
{
private object m_valueMax;
public TestClass(object value)
{
m_valueMax = value;
}
public object Value
{
get
{
return m_valueMax;
}
}
}
because I simply needed a number to be passed it, and do not
need to be doing stuff like
if (value == null)
throw new ArgumentNullException("value");
Best regards,
Paul
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
I have a Windows Forms application that has problems with a web service reference. When I add the Web Reference, and try to go to design mode on the main form, I get an "Object reference not set to an instance of an object." error. There is no line number, no indication of what object or where in the code, just that error. Removing the web reference completely from the project resolves the problem, and adding it back causes the problem to appear again.
Does anyone know why I would be getting such an error when I add a Web Reference to a windows forms application? Its a very confounding problem, and I havn't been able to find anyone else on the net having the same problem. I appreciate any help.
|
|
|
|
|
I've got a strange problem when using the standard save/open file dialog Windows Forms controls in C#/.NET applications. When I call the "ShowDialog()" method, the dialogs open and behave normally in every way, except that all of the icons for folders and files have a black background, and the buttons on the left hand side of the dialog - for Desktop, My Documents, etc - are totally black. Does anyone have any ideas?
Thanks.
|
|
|
|
|
I am having the same issue. The issue has started in the past month. We believe the Dec 13th .NET framework update may have caused the issue.
I have also seen the file name text box and the file type drop down missing. There may be a floating empty drop down on the form above the bottom panel section.
Have you had any progress on determining the cause of the issue and a resolution?
|
|
|
|
|
Hi.
How do I force Windows to go standby using the .net framework in C# ?
also
How do I force Windows to shutdown ?
thanks 
|
|
|
|
|
|
hello friends,
i just want to know wheather their is any api in .Net,com etc for geting the open with dialog,as like we get in windows when we try to open any of the files with no extentions.
if there is any other implementation other than reading from the registry ,plz let me know.
regards
Deepak
deepak
|
|
|
|
|
I feel useless!
I am trying to develop an app in VS. Specifically I am trying to build an app that has several frames. Here's my problem. I am trying to set up one of the frames as an aspx (so I can program the code behind page) but I can't. It seems you can associate the frame with an html page but not an aspx document. How do I get around this? I suspect that my whole appraoch is fundamenatlly flawed but at this time I don't know how so.
thanks in advance.
Brian
|
|
|
|
|
For some reason this returns false on my machine (SP2 VS 2005 Beta 1 latest refresh IPv6 installed). However my app (currently only a simple test app) runs binding to a IPv6Any interface and I can connect to it via an IPv6 Address. Anyone have any ideas?
Matt Newman
Even the very best tools in the hands of an idiot will produce something of little or no value. - Chris Meech on Idiots
|
|
|
|
|
Looking through the decompiled code for SupportsIPv6 reveals that there's a configuration property ipv6[^] which must be enabled in order for this property to return true .
I'm not too sure why this is required - perhaps you should report it as a bug on the Product Feedback Center[^].
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hello everyone
Sorry to be asking so many questions...
I have seen a few examples around the net where people are passing bytes in to functions wanting ints, without any problems what so ever...
e.g. Color.FromArgb (0x99, 0x99, 0x99);
I have also seen this being used when an overload expects a float value;
e.g. g.DrawImage(img, (int) (rect.X + 4), (int) (rect.Y + 2), 0x10, 0x10);
All these compile fine!
Now is there a reason why someone would choose this method over just passing an int or float?
Is there any benifit to this?
Sorry, a very trivial question, but has got me very intregued!
Thanks in advance
Al
|
|
|
|
|
Those things are hexadecimal numbers. Some people use them for defining color values because they are just used to it. But I think they (the hex codes) will mostly be used for unmanaged api calls, because most constant values are public available as hex codes and not as normal integers. Ive never seen them used in conjunction with non constant float values 
|
|
|
|
|
Thanks for the response.
Yes, I'm not sure why they would / could use them.
I thought it may be a method to create slightly faster / more efficient code as the compiler would not have to parse int, floats etc to the Hex equivilant...
I have not been able to find any Microsoft references even hinting that you can use hex values for int and float variables 
|
|
|
|
|
Hello Everyone
I am just wondering what methods there to protect your DLL's bundled with your own application from being used by another developer / application?
I have written a few UI components that I'd like to protected. I have obfuscated them and will be purchasing Salamander soon to completly protect it from decompilation, but non of these will stop another developer just using the component.
Any thoughts / ideas / previous experiences would be greatly appreciated.
|
|
|
|
|
If you look at the properties of a control in the Visual Studio property grid then it shows the controls Name property.
If you put a PropertyGrid control on a form and set its SelectedObject property to a control then the Name property of that control is not displayed.
How does Visual Studio get the Name property of a control to display?
|
|
|
|
|
I want to implement an online chat in my web site in ASP.net.It will be a support channel type chat where clients will log in and request support from the server agents.Can some one provide me with a sample.i would really appreciate.
waiting for reply ....
Prepare yourseld for the life after death.God bless you.
|
|
|
|
|
Im trying to parse the following
"Someword, another. SD-FR1 more WORDS"
And i would like to capture the "SD-FR1" part.
I know it consists only of capital letters, numbers or "-".
I also know that it contains at least one capital letter and one number but not in what order. It should work on
"Someword, another. S1R more WORDS" capturing "S1R" aswell.
Anyone know how to do this with .NET RegEx?
I've read and googled but havn't found any examples where you dont know the order of what you're searching for.
Thanx for your time
Fredrik Högberg
|
|
|
|
|
Hi,
When I use Process.Start() to start my DX GUI application from my .NET Service I can see the process starts correctly because it shows up in the task manager, but the Form does not get shown.
If I'm not doing something obviously wrong, I think I have to do something special to achieve this.
Does anyone know how I can do this?
|
|
|
|
|
Hi,
I want to find out all the components in the system that are not shared side-by-side. For this I need to check whether the given component is side-by-side shared or not?
How I can achieve this?
Can that information be achieved thru file version info?
What are .menifest file?
|
|
|
|
|
requirement - form has apply, ok, cancel buttons. apply, ok initially greyed out. on an edit change (edit control, radio button, combo, listbox, grid etc.) set member var flag m_dirty = true, and enable apply, ok. Form may possible contain tabcontrol and tabpage children. All forms in app are derived from a base form with the apply, ok, cancel buttons on it.
my two ideas so far:
1) override wndproc in base form and trap all wm_command msgs, see if they are from an edit, radiobutton etc. and then see in EN_CHANGE or appropriate was sent, set dirty in this case.
2) recurse form and all control containers (panel, groupbox, tabpage), and hook up an event handler to every control (edit, radiobutton etc.) for appropriate event (OnTextChanged, ButtonClicked etc.) and in that event handler set form dirty.
Im hoping there is an easier way to do this. Im trying to avoid going thru a whole bunch of existing forms to setting dozens of event handlers manually. Im hoping to have some code in the base form that implements this using something like 1 or 2 above, or preferably some much easier way some .net brainiac can suggest.
tia. sg.
SGarratt
|
|
|
|
|
The second one sounds appropiate to me. You could implement that as a protected function in your base class. All you would have then to do is to call it from every form inheriting from your base form after the InitializeComponent call.
To avoid this (the recursive search) you could also handle the ControlAdded event in your base form and bind your event handler for setting the flag right when a control is added. In this case you would have to bind the ControlAdded event also for each inserted container control.
|
|
|
|