|
You haven't set the parent of the child form. When you create an instance of the child form, set its MdiParent to the MDI form. In C#, this would be:
ChildForm form = new ChildForm();
form.MdiParent = this;
form.Show();
|
|
|
|
|
I have written following in VB.Net
Dim childform As New Form1
childform.MdiParent = Me
childform.Show()
Do I need set some other property of childfom?
|
|
|
|
|
thanks
|
|
|
|
|
Hi,
I have created a service not specifying the username/credentails i.e. local-account. I am trying to change the user to "domain\username" dynamically using ChangeServiceConfig API. This API always returns me error code 87 i.e. “The parameter is incorrect”.
I have explained the problem below. Does anyone why this behavior?
I have detailed the steps below:
I have an issue. I create a service under the local system account. After that I am trying to change the user to domain\user. E.g.: if my domain name is “MSDN” and username name is “me”, I am trying to change the user credentials to “MSDN\me” using the ChangeServiceConfig API. This API is always throwing me an error 87 i.e. “The parameter is incorrect”.
#define SZSERVICENAME “Trial”
ServiceCreate()
{
schSCManager = OpenSCManager(NULL, // machine (NULL == local)
NULL, // database (NULL == default)
SC_MANAGER_CONNECT | SC_MANAGER_CREATE_SERVICE // access required
);
schService = CreateService(schSCManager, // SCManager database
TEXT(SZSERVICENAME), // name of service
TEXT(SZSERVICENAME), // name to display
SERVICE_ALL_ACCESS, // desired access
SERVICE_INTERACTIVE_PROCESS|SERVICE_WIN32_OWN_PROCESS, // service type
SERVICE_AUTO_START, //SERVICE_DEMAND_START start type
SERVICE_ERROR_NORMAL, // error control type
szPath, // service's binary
NULL, // no load ordering group
NULL, // no tag identifier
TEXT(SZDEPENDENCIES), // dependencies
NULL, // LocalSystem account
NULL); // no password
}
ChangeServiceParms()
{
//Domain = “msdn.try.com”, computer name is “comp”
LPTSTR szServerDNS = “comp.msdn.try.com”;//Fullname of the computer
LPTSTR szAccountDN = “MSDN\me”;// User to which I am trying to logon
SC_HANDLE schSCManager, service;
schSCManager = OpenSCManager(szServerDNS,
NULL,
SC_MANAGER_CONNECT );
ervice = OpenService(schSCManager,
TEXT(SZSERVICENAME),
SERVICE_ALL_ACCESS);
BOOL success = ChangeServiceConfig(service,
SERVICE_NO_CHANGE,
SERVICE_NO_CHANGE,
SERVICE_NO_CHANGE,
NULL,
NULL,
NULL,
NULL,
szAccountDN,
NULL,
NULL);
if(!success)
{
DWORD err = GetLastError();
}
}
|
|
|
|
|
nlharshini wrote: LPTSTR szAccountDN = “MSDN\me”;// User to which I am trying to logon
Are you aware that the backslash character is an escape character?
|
|
|
|
|
What does your question have to with Windows Forms?
/ravi
|
|
|
|
|
I'm not sure whether this can be achieved, but here goes.
I have created a new color dialog for a simple html editor. I would like to packeage the form into a dll, so that when added to a project, the dialog appears in the toolbox. I am using C# express 2005. I can achieve this when creating a normal control but I am stumped when it comes to having a form in the dll instead.
If anyone has any ideas as to how to achieve this, or even a small demo, I would be truly grateful.
|
|
|
|
|
This is actually done quite frequently. It wouldn't be a Control in the DLL, but rather a Windows Form in the DLL, which you can initialize and invoke just like you would with any other form outside of the DLL.
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
Hi, Yes I can do this. What I want to achieve, is see the form like the current colordialog in the toolbox to the side of the design window.
|
|
|
|
|
Mike Kitchen wrote: Hi, Yes I can do this. What I want to achieve, is see the form like the current colordialog in the toolbox to the side of the design window.
In design view, just right-click on the Toolbar, choose "Add/Remove Items" and select your custom library that contains your control. You can only do this for custom controls though, not for actual forms.
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
Mike Kitchen wrote: like the current colordialog in the toolbox to the side of the design window.
Then you need two things. You need the custom control with a designer implementation so it can be in the toolbox and dropped on a form by a developer. The interface (API) you create for the control supplies the mechanism that is used at runtime to launch the Windows Form that is also in the assembly (or in another assembly I suppose).
|
|
|
|
|
OK. I am being a bit slow with this. So could you point me in the right direction to achieve this please. If I get it sorted I will post the dialog as an article.
|
|
|
|
|
I doubt you will find an example of doing exactly what you intend. You need to piece the inforamtion together. I suggest you first learn how to create a custom control. That's pretty simple but then you need to learn about implementing the Visual Studio designer support. From there you should be able to see how your non windowed control is used by a developer to implement the showing of the form that is in the assembly. My original post contains the key words you would use in google to start researching, something like:
MSDN Windows Forms custom control designer
|
|
|
|
|
Hi
Yep, started doing a few google searches and I have come up with a few links, so hopefully I am on my way with it now.
Thanks for the help, and if I get it sorted I will post the control as an article.
|
|
|
|
|
I have a ClickOnce application downloadable on the web set to be Online only - no install on user's machine.
One user couldn't get it to work. Then, looking at screen shots she sent me, realised that the custom error messages did not match the text that I could see in front of me in VS.
So I changed the title of the form in question, bumped up the build number, just to be sure there hadn't been a typo and I was publishing a lower number, re-published and when the screen shots came back, it was an older version of the app that was running(which doesn't exist on the web server)
It works perfectly on my PC.
The user claims to have cleared all Temp files and browsing history to no effect.
All I can think of is that this might be related in some way to the WINDOWS\Prefetch folder. Could the app have gotstored on the PC even though it's designed not to install locally?
Anyone have any ideas?
Rich
|
|
|
|
|
How to Generate the Crystal report in Asp.Net using C#
nadi
|
|
|
|
|
Is to export the report to PDF and then render the pdf.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
hello can somebody tell me how to get the binary data sended by a joystick connected on my pc through a serial port
regards
dghdfghdfghdfghdgh
|
|
|
|
|
|
originSH wrote: Is google broken?
Always works fine here.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
|
besmel wrote: but... nobody had the same trouble moving from MFC ?
Yes and I used that article as a basis to create a framework for a solution. I basically refactored that design to use Generics in .NET 2 platform to eliminate the use of "object" all over the design. I have found it very useful so far.
|
|
|
|
|
It is invalid to show a modal dialog or form when the application is not running in UserInteractive mode. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: It is invalid to show a modal dialog or form when the application is not running in UserInteractive mode. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
Source Error:
Line 27:
Line 28: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Line 29: MsgBox("")
Line 30: End Sub
Line 31: End Class
Source File: c:\inetpub\wwwroot\WebApplication2\WebForm1.aspx.vb Line: 29
Stack Trace:
Thankyou,
Kalyan.
|
|
|
|
|
2 points.
1. This is the Windows Forms forum, not the ASP.NET forum. Please don't post into inappropriate forums.
2. You're trying to show a messagebox in code that runs on the server, where normally there won't be a logged in user. Don't do it.
|
|
|
|
|
You are best to ask asp.net related questions in the asp.net forum.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|