|
Can you tell me the keywords for this kind of controls?
Thx,
Nuno
|
|
|
|
|
dock control c#
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
|
|
In code project itself its there , including it's source code .Frankly it's complete
Develop2Program & Program2Develop
|
|
|
|
|
Hi Everyone, I'm a log time fan of CodeProject, former C++ guy, now C# guy. Here's what I need help with if you please:
I have a Windows Forms app (C#, VS2005, .NET 2.0) with a grid control on it, the grid control will be populated with information collected from a call to a SOAP WebService. The workflow is:
1. App starts up - main window is hidden
2. App pops up a dialog asking for logon / password
3. Logon dialog hits webservice and gets back a token
3a. If user cancels login, exit application
4. Main window appears with a grid control on it that is empty
5. Main window uses token from web service to make calls to get data from webservice and display on the grid
Here is my problem: I don't want the main window to appear before the user completes the process of logging on with the login dialog. However, I can't figure out how to get my application to start with my main window hidden except to launch the login dialog from the main form's constructor (gross!!). I try to use the Windows Form methods I can find like Hide() which will hide the window, but the problem is you'll see it before it gets hidden. I don't want it to appear at all until the user is done with the login window. I've tried modeless dialog for the login dialog, modeless etc.
The desired effect that I can't achieve (without putting login form's instantiation and execution in the Main Form's construtor) is that you never see the main form until after login successfully completes, and if login is cancelled the program exits and you never see the main window at all.
Thanks a lot for any help!
|
|
|
|
|
Unfortunately, you do need to call the login dialog before you call the code to create the main window. This could be accomplished from your static void Main() code:
public static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
SecurityClass sec = new SecurityClass();
if (sec.AuthenticateUser())
{
Application.Run(new MainForm());
}
} Them the security class would be responsible for identifying whether or not the user was valid. This would involve displaying your login dialog. By doing this, you don't hit the Application.Run until you've validated that your user exists.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thank you Pete, I did this and it works but I have a question:
public static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
SecurityClass sec = new SecurityClass();
if (DialogResult.Ok == sec.ShowDialog())
{
if (sec.AuthenticateUser())
{
Application.Run(new MainForm(/* pass in sec if necessary */));
}
}
}
If we can open windows before we call Application.Run what does Application.Run do for us? Why do we need it at all? Online reference says this:
Application.Run:
Begins running a standard application message loop on the current thread, and makes the specified form visible.
How is the application message loop different from the windows message queue? What happens to my app if I don't have one of these 'standard application message loop's?
Thanks if anyone can explain!
|
|
|
|
|
If you don't call Application.Run then the application will stop as soon as it leaves the Main() method. Try it - call new MainForm() without calling the Application.Run. This will end your application before you would normally want to do this.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
How ew get SQL qurry result to a text box
era
|
|
|
|
|
wrote: How ew get SQL qurry result to a text box
Do you two guys sit next to each other, or is it the same homework?
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
How we get a SQL query result to the text box
iroshika
|
|
|
|
|
wrote: How we get a SQL query result to the text box
Do you two guys sit next to each other, or is it the same homework?
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that.'" - Tommy (Tommy Boy) "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
HI ,
i'm trying to make a simple version of VS's collapsible pannels.
I know there are collapsible panels in the articles section but i want to keep it simple.
I use the [Panel] control , i can have it hide and show with the user clicking or hovering over a long flat(looks better) button.But i still dont have one important functionality. The pin feature.
In VS , if i click the pin/auto hide button the controls in the panel show up on a SplitContainer panel:
http://gidsfiles.googlepages.com/splitcontainer.jpg[^]
Even outlook 2007 and probably older versions have this feature:
http://gidsfiles.googlepages.com/outlook_expand_todo.jpg[^]
If i click that button , the collapsible panel is no more collapsible and is now in a splitcontainer panel.
http://gidsfiles.googlepages.com/outlook_expand_splitview.jpg[^]
Continuing with my panel concept,i have a litte pin button , i tried removing the Panel from the Form.Controls collection and adding it into splitcontainer.Controls when it is clicked.
Like this:
Code:
private void btnPin_Click(object sender, EventArgs e) {<br />
if (splitContainer1.Panel2Collapsed) <br />
{ <br />
splitContainer1.Panel2Collapsed = false; this.Controls.Remove(panel1);<br />
splitContainer1.Panel2.Controls.Add(panel1);<br />
panel1.Visible = true;<br />
} else { <br />
splitContainer1.Panel2Collapsed = true;<br />
splitContainer1.Panel2.Controls.Remove(panel1); <br />
this.Controls.Add(panel1); panel1.Location = new Point(12, 277);<br />
panel1.Visible = true; <br />
} <br />
}<br />
Yes , it does not work at all , the panel never shows in the split container.
Could someone please help out?
Thanks so much
Gideon
|
|
|
|
|
Thats something i really want to use too. I though this controls were already available out of the box.
Arent they imported somewhere?
Nuno
|
|
|
|
|
Hi,
I have one MFC application some times it gives me error message "A Required resource was" and I have to close application
from taskbar.
Can ayn one tell me what is that and how to ovecome it.
Thanks,
Rushiraj
|
|
|
|
|
please some body tellme how to find the version of a bios using dos debug cmd
and also to enable and disable passwd of bios using debug command
ads its mes
|
|
|
|
|
Hi,
In a Windows Form I created a set of ToolStripMenuItems.
I am looking for a method to list, for a specific ToolStripMenuItem, the Click EventHandlers (if any) so as to add them to another control.
I found System.Reflection.EventInfo class which seems to achieve this kind of enumeration but I did not found how to make it work.
PS : I'm using VS2K5 and FW 2.0.
Thanx in advance
|
|
|
|
|
Hi friends,
Today i have create the form in ASP.NET by using the R.A.D. Component (treeview)
Now i want to add the content to that treeview dynamically. I don't no how to do that. Any one help me please.
Regards,
A Jabeer Ali
|
|
|
|
|
How do i restrict user from entering any alpahabet or special characters in my textbox, in the textbox key press event. I need to give a error message and no alphabets or special charaters should get printed.(in visual C#).its a window form.
|
|
|
|
|
I'm not sure which characters you wish restricting. I'm assuming you're saying you only want numeric keypresses here.
In the keypress event, you add the following code:
if (!char.IsDigit(e.KeyChar))
e.Handled = true;
If you want to display an error message, you should use the error provider component and set its text at the same point that you set the e.Handled flag.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thanks a lot.. . It worked..
|
|
|
|
|
It may belong under WTF or Soapbox, but I just found this:
The value of the HelpButton property is ignored if the Maximize or Minimize buttons are shown.
Does anyone here have an easy workaround that allows all three buttons to be on the Caption Bar?
(Using .net 2.0)
|
|
|
|
|
It's not an easy workaround: you'll need to paint it on the title bar yourself. For that you need to handle the WM_NCPAINT and WM_NCHITTEST messages. See DrawFrameControl for how to draw a Windows 2000-style help button (DFC_CAPTION and DFCS_CAPTIONHELP ) and DrawThemeBackground /DrawThemeIcon (part WP_HELPBUTTON and the appropriate state) for Windows XP-style themed buttons.
For Windows Vista it probably won't work very well since Aero draws the title bars normally, if in 3D mode; if you handle WM_NCPAINT it will turn off the standard frame painting for that window, I believe. You'd probably have to start playing with the Glass API to make it still look like a Windows Vista window.
The limitation is from Windows itself: the documentation for CreateWindowEx says "WS_EX_CONTEXTHELP cannot be used with the WS_MAXIMIZEBOX or WS_MINIMIZEBOX styles." In other words, Microsoft did not intend it to be used like this.
Edit: yes, I realise this is the Windows Forms forum. You need to override the WndProc method to handle messages that Windows Forms doesn't already translate to method calls/events.
|
|
|
|