|
I'm trying to use an ocx written in VB6 in my C# app and
when i try to show a form ("click a button") i get an error message
"run-time error 406 Non Modal Forms cannot be displayed ... "
what can be done if i need these forms Non Modal?
thanks
sharon
thanks
sharon
|
|
|
|
|
Personally I haven't worked much with this stuff, but from what I read I think that it might be a problem with how .net works with the ocx. Take a look at this article: http://support.microsoft.com/default.aspx?kbid=176468[^]
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Are you talking about a ASP.NET app ??. For example in ASP.NET you are executing the application in the context of a web application and you can only show WebForms..
Try compiling as exe
~Alexander Kent
|
|
|
|
|
No i'm talking about a windows app in c#
have any ideas ?
10x
sharon
thanks
sharon
|
|
|
|
|
does the .net framework have a class and constants for working with bits already defined or do i need to write my own
|
|
|
|
|
|
hello i am trying to move a form based on where the user clicks however it doesnt go where it supposed to ive tried 3 different ways and none work
here is what i have tried
this.Location = PointToScreen(MousePosition);
this.Location = PointToClient(MousePosition);
and
this.Location = MousePosition;
none of these work properly what am i doing wrong.
do i need to do anything to get MousePosition becuase im just using it im not initializing it
or anythning
can someone please give me tips
thanks
|
|
|
|
|
Please clarify what you are try to accomplish.
When the user clicks where?? Abitrary point on the screen? Inside your form?
Note your application cannot pick up mouse clicks outside the form.
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
when the user clicks on the form. the form is in an mdi app
|
|
|
|
|
Once again just to confirm, have u tried like this:
Also note what Alex has mentioned: You can not pick the point outside the Form.
private void Form1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
this.Location = PointToScreen(new Point(e.X, e.Y));
}
|
|
|
|
|
it still seems to offset the dialog like an inch below and to the right
|
|
|
|
|
It does not occur in my demo application. Please re-check and revert back.
|
|
|
|
|
this is the code i have
<br />
private void EditEmp_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)<br />
{<br />
dragging = true;<br />
this.Dock = System.Windows.Forms.DockStyle.None;<br />
this.Location = PointToScreen(new Point(e.X, e.Y));<br />
}<br />
>/code><br />
<br />
and it doesnt move the dialog to where my mouse is
|
|
|
|
|
Do u want to drag the form using mouse in run-time, the way u do while holding title bar of the form?? Be very clear please...
|
|
|
|
|
yes i already am able to make the form move via the mouse move event and im using the same location logic and it still follows at a distance.. i think i may know why its doing this tho but i dont know the solution when the user click the form its using the forms mouse positon and not the parents how can i get the parents coordinates for the mouse when i click in a child form?
|
|
|
|
|
You would have told me before...I simply wasted my time. I know there will be offset in this logic, if u want to drag the form.
in mean time, try solving it at yr end.
I will try to work out and post the solution probably tomorrow......
|
|
|
|
|
Im not going to give you a code solution. Here is how you do it (psuedo-code straight from my head, hopefully no mistakes):
Point originalFormLocation;
Point originalMouseDownLocation;
bool state;
onMouseDown()
{
state = moving;
}
onMouseMove()
{
if (state = moving)
{
}
}
onMouseUp()
{
}
Note: you're always working with screen coordinates.
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Yes..Alex...This will work perfect. I had implemented the same in my previous project. Only little bit of correction is required...You do not need to save the form's location in MouseDown (If I remember correctly..).
|
|
|
|
|
OK As long as you can get it to work.
I believe saving the original coordinate at begining is necessary to get error free moving. If you're not moving relative to the point where you start but you're doing something relative to the last time the mouse was moved you can get some big glitches.
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Actually Previous MouseDown Location's coordinate is relative the the previous Form location,
And If you see with reference to the screen , The mouse down location saving should solve the purpose....
I will try to post the code tomorrow...
|
|
|
|
|
I've searched all over and haven't been able to find much help with burning data CDs in C#. I saw one article that used IMAPI Wrapper, but it was originally written in VB and I haven't been able to get even their source code C# version to compile properly.
Any help?
17 years old with too much free time.
...cooler than the other side of the pillow.
|
|
|
|
|
Have you taken a look at the IMAPI wrapper by Steve McMahon? IMAPI_Wrapper[^]
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Yes, but I haven't been able to get it working, something about the reference to the .dll is wrong. I'll edit this post with greater details later tonight when I get off work.
17 years old with too much free time.
...cooler than the other side of the pillow.
|
|
|
|
|
I've tested the latest code with Visual Studio .net 2003. You just have to take out the lines for assembly signing.
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
hi there ,
in my Form i have 40 textbox filds
i want to ensure that all of them has data inside
all of the filds must have a valid values inside
how can do a loop that cahek all of the filds in my Form in one click ?
maybe somene have an sample
thanks alloot
|
|
|
|