Visual Inheritance for ComboBox
Hi All,
Just been toying around with inheriting from the ComboBox control. See below
a simple example of the new ComboBox class.
// start MyComboBox.cs file
using System;
using System.Windows;
using System.Windows.Forms;
using System.Drawing;
namespace MyComboBox.UI
{
/// <summary>
/// Summary description for MyComboBox.
/// </summary>
public class MyComboBox : ComboBox
{
public MyComboBox()
{
this.ForeColor = Color.DarkBlue;
}
protected override void OnHandleCreated(EventArgs e)
{
if (this.DesignMode)
{
this.Items.Add("Design Mode");
}
else
{
this.Items.Add("Run-time Mode");
}
this.Items.Add("Orange");
this.Items.Add("Apple");
this.Items.Add("Pie");
}
}
}
// end
There's no problem adding the control to my toolbox. Also - no problem
dragging and dropping the custom combo onto the design canvas.
Strange thing is, after switching between design time and code a couple of
times and running it - the font seems to change into a bigger font,
something like Arial bold or such.
Also, I suppose I need to specify some attribute tags before the class
definition. Any ideas or suggestions?
Thanks a bunch,
Wim Hollebrandse Tag: Dropdown Grid Tag: 52023
Menu shortcut keys do not work when Form.Show is called.
I have a form that I build in C# that does not seem to annunciate a menu
item selection when a shortcut key is pressed. It only seems to occur if I
display the form using the Form.Show() method. The problem does not seem to
occur when I use Form.ShowDialog().
Can someone explain how I can get around this problem?
--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.
varnk@diebold.com
----------------------------------- Tag: Dropdown Grid Tag: 52012
MDIChild forms maximizebox.
Hello ALL,
I have this situation:
1. A MDI Form named frmPrincipal;
2. A MDIChild form named frmCustomers;
When I show the frmCustomers form, from a click event of a button of
frmPrincipal, like this:
frmCustomers.MdiParent = this;
frmCustomers.WindowState = FormWindowState.Maximized;
frmCustomers.Show()
The frmCustomers form shows ok, but the minimizebox, maximizebox and
controlbox appears, and I can´t like this.
In the frmCustomers properties I set false to maximizebox, controlbox and
minimizebox, but they appears yet.
I try to remove the border of the form (set FormBorderStyle = None) but
don´t work too.
Please, how can I hide this buttons?
Thanks in advance and sorry my English.
Fernando Lopes
Marília - São Paulo - Brazil. Tag: Dropdown Grid Tag: 52009
Problem with drawing over the top of a background form
Hi, I am hoping someone can point me in the right direction. I am working on
a program that has a form that has a background mage that the user can
change. Currently I assign in directly to background image. After an image
is assigned to the background the user has the ability to draw rectangles on
the image using the mouse to define the regions. To do that I create a
bitmap and constantly redraw the rectangles on it that are stored in a
linked list each time the form repaints.. the problem is that because of
this bitmap, I never see the image assigned to the background. Of course
this makes sense since I am creating a bitmap. I've tried setting the bitmap
to be transparent, and that allows me see the background image, but
everytime I use the mouse to draw or resize a region, it doesn't refresh
properly and I'm left with tons of rectangles on the screen, instead of just
the final rectangles position. Is there any easier way to do this? I've also
tried to assigned the .BMP image I use directly as the bitmap I am creating
the rectangles on rather then the background, but then I get another error
saying
"Additional information: A Graphics object cannot be created from an image
that has an indexed pixel format."
The bmp is an 8 Bit format image. I've also tried converting it to a GIf
with no success.
I was going to post some of the code, but figured the post was long enough,
if anyone is interetsed in seeing what i have so far, just let me know. I
appreciate any help you guys can give me. Tag: Dropdown Grid Tag: 52006
Simple way to force a form to validate
Is there a simple way to force a form to invoke validation on all its
controls.. I want to do this on a button_click prior to doing some
processing..
Thanks Tag: Dropdown Grid Tag: 52005
HOWTO: Remove the left indicator column of a datagrid?
Hello ALL,
Please, is there any way to remove the indicator column (that´s in the left)
of a datagrid in windows forms?
Thanks for help.
[]s
Fernando Lopes
Marília - São Paulo - Brazil Tag: Dropdown Grid Tag: 52002
Pointing to custom forms
When we create a new win usercontrol project(any type of
project really), IDE creates a default usercontrol form
for us. Is there a way to set IDE so that instead of this
default form, It creates a custom form?
thanks Tag: Dropdown Grid Tag: 51992
Am I doing something wrong? (Variables)
Hiya all,
I am developing a windows form application. I am coding in C#. What I have
is two forms/Classes, frmMain & frmAdd and they both have the same default
namespace "Q.A._Testing_Centre". In frmMain I have initialize & instantiated
my variable as "public string userName", where the user input name is
stored. I am trying to get the stored data propertied from my frmMain to my
frmAdd. I thought this is the correct syntex for outputting the info in my
textbox (scratching my head), maybe it's not. So please let me know if you
can help, or where I'm going wrong. Code is as follows:
namespace Q.A._Testing_Centre
{
public class frmMain : System.Windows.Forms.Form
{
public string userName; <<<---- I want the data from here
...
...
...
namespace Q.A._Testing_Centre
{
public class frmAdd : System.Windows.Forms.Form
{
private void SubMainMenu()
{
frmMain Main = new frmMain();
txtBoxSample.Text = Convert.ToString(Main.userName);<<<--- to output in my
textbox here
...
...
...
I have tried a sample textbox with in frmMain and this data is in fact
stored until I exit my program. But I cannot seem to reproduce the same
textbox output in frmAdd. I seem to get a blank textbox area. Alternatively
I have try "txtBoxSample.Text = Main.userName" syntex which does not work as
well.
Or maybe if someone has a better alternative, please feel free to let me
know.
All help is truly appreciated & thank you all in advance.
MikeY Tag: Dropdown Grid Tag: 51989
Searching for folder Zip/Unzip utility.
I have tried alot in searching for API to make an utility
for zipping and unzipping the folders in vb.NET. If any
one has the idea to create this utility by using .net
framework please let me know.
regards
sandy Tag: Dropdown Grid Tag: 51982
list of mdi children in a submenu of mdiparent
Hello,
I would like to have a list of mdi children in a submenu of mdiparent.
the list should be refreshed dynamically when mdi children are created and
destroyed. mdi child should be activated when the user clicks the menu item.
I have some results but I am not satisfied (deep problems with
MdiChildActivate).
Maybe there's an article or an example on how to do that?
Regards,
Wiktor Tag: Dropdown Grid Tag: 51981
Component Errors
I am Intermediate VB Programmer. I develop an
application recently which I intend install on a server
network. But when I was testing software on the server, I
encountered a problem(ie when I tried to load the
application on the network from one of the client comptuer
(work-station). It was complaining of Some components
either missing or not properly registered. And these were
some of the component I used for the program such as
MSAdodc.Ocx... Inshort,some most of the activeX component
that I used.
Apart from developing a server and Client
Application,is there no other ways that can make this
applicatio work properly for me while application is on
server system and been accessed from the client computer?
I will be very grateful and thankful, if I can get
the solution right away.
Thanks Tag: Dropdown Grid Tag: 51976
Disable Ctl+Alt+Del C#
Dear Friends,
How to disable the start,windows task
manager,Ctl+Alt+Del buttons through C#?,
If any one knows please let me know...Any suggestions would be greatly
appreciated.
Thanks,
Dev Tag: Dropdown Grid Tag: 51975
DateTimePicker BackColor Property
Hi,
for those of you, who need a backcolored DateTimePicker
control:
this ist my implementation of the BackColor property for
the standard DateTimePicker Control (which does not work):
public class MyDateTimePicker : DateTimePicker
{
#region internal set backcolor hack
private Color _BackColor = SystemColors.Window;
public override Color BackColor
{
get
{
return _BackColor;
}
set
{
_BackColor = value;
Invalidate();
}
}
protected override void WndProc(ref Message m)
{
if (m.Msg == (int) 0x0014 /* WM_ERASEBKGND */)
{
Graphics g = Graphics.FromHdc(m.WParam);
g.FillRectangle(new SolidBrush(_BackColor),
ClientRectangle);
g.Dispose();
return;
}
base.WndProc(ref m);
}
#endregion
}
... seems to work quite well.
claudio Tag: Dropdown Grid Tag: 51969
Double Click on TreeView
Hi all,
I wanted to know if a node in tree view is double clicked,
I tried clicks property on MouseDown but it always returns 1.
any solutions for this problem
regards,
... Tag: Dropdown Grid Tag: 51966
Why this does not work?
Hi:
This is a little program. It has a thread that calls trough Invoke to a
method called Draw. The Draw method draw elements within the Panel control.
For some reason, the program does not close sometimes. Please semd me
comments about this.
Thanks!
Juan C. Olivares
// project created on 11-07-2003 at 0:31
using System;
using System.Drawing;
using System.Threading;
using System.Windows.Forms;
namespace MyFormProject
{
delegate void DelegateCallDraw ();
class MainForm : System.Windows.Forms.Form
{
private System.Windows.Forms.Panel panel;
private DelegateCallDraw CallDraw;
public MainForm()
{
InitializeComponent();
panel.AutoScroll = true;
// Add controls
this.Draw ();
// Create delegate
CallDraw = new DelegateCallDraw (Draw);
// StartThread
Thread thread = new Thread (new ThreadStart (StartTimer));
thread.Start ();
}
// This method is used in the forms designer.
// Change this method on you own risk
void InitializeComponent() {
this.panel = new System.Windows.Forms.Panel();
this.SuspendLayout();
//
// panel
//
this.panel.Location = new System.Drawing.Point(16, 16);
this.panel.Name = "panel";
this.panel.Size = new System.Drawing.Size(264, 128);
this.panel.TabIndex = 0;
//
// MainForm
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 161);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.panel});
this.Name = "MainForm";
this.Text = "This is my form";
this.ResumeLayout(false);
}
private void Draw ()
{
panel.Controls.Clear ();
panel.SuspendLayout ();
for (int i = 1; i <= 20; i++) {
TextBox tb = new TextBox ();
tb.Text = i.ToString ();
tb.Location = new Point (0, (i - 1) * tb.Height);
panel.Controls.Add (tb);
}
panel.ResumeLayout ();
}
private void StartTimer ()
{
while (true) {
// Sleep 10 secs
Thread.Sleep (1000 * 10);
// Call draw
this.Invoke (this.CallDraw);
}
}
[STAThread]
public static void Main(string[] args)
{
Application.Run(new MainForm());
}
}
} Tag: Dropdown Grid Tag: 51964
Assign Property To ErrorProvider
I added an Error Provider to a VB.Net windows form called Err1. When I add
a text box to the form, I get a property called "Error on Err1" because I
added the Error Provider. How can I access this property in code to set a
value to it?
Derek Tag: Dropdown Grid Tag: 51954
ContextMenu will not close after mouse click
When the ContextMenu is associated to a control(Panel, Button...) on a
Windows Form, ContextMenu.Show() can popup the menu. But the menu
stays open after mouse click.
It worked perfectly on the form itself.
Any Idea? Tag: Dropdown Grid Tag: 51941
Is print preview in .NET wothwhile?
Hi!
I am preparing to write a small library for generating reports. One of
the key features is that it must support print previews. .NET has a
PreviewPrintControler but according to the docs it is keeping the whole
preview in Images. The library should be able to preview quite large
reports (over 100 pages) also on resource starving computers (like 64 MB
RAM 300 Mhz Celerons). Would PrintPreview eat the whole memory available
or does it have some optimizations to counter the problem? What are your
experiences?
Regards!
Micha³ Ziemski Tag: Dropdown Grid Tag: 51940
Odd problem with InputBox
hey all, I am having an odd problem with the InputBox in VB.NET, and it ONLY
happens on one of my computers. When I try "Dim x as String =
InputBox("TESTPROMPT"), I get the following error:
----------------------------------------------------------------------------
----
[Exception Details]
----------------------------------------------------------------------------
----
System.ComponentModel.Win32Exception: Class already exists
at Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o,
Type objType, String name, Object[] args, String[] paramnames, Boolean[]
CopyBack)
at NexGen.Environment.RaiseSpecialEvent(String& strAction, Object&
objSender) in Z:\Source Code\Presentation
Tier\VB.NET\NexGen.Environment\Environment.vb:line 73
at AMC.frmMain.frmMain_Load(Object sender, EventArgs e) in Z:\Source
Code\Presentation Tier\VB.NET\NexGen.AMC\frmMain.vb:line 2517
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
any ideas?
TIA
Nick Jacobsen
njacobsen@pfastship.com Tag: Dropdown Grid Tag: 51932
Datagrid.Backgroundimage propertry (VB.NET)
How can I show an image in the background of the datagrid?
the Backgroundimage property has no effect....
tnx!
bill Tag: Dropdown Grid Tag: 51931
Having Property Grid Display Properties from the Most Derived Class
I would like to use the PropertyGrid control to allow users to edit the
properties of a control, however, I would like only the properties of the
most derived several classes to be visible.
How is this possible?
--
Howard Swope
Software Engineer
Spitz, Inc [http://www.spitzinc.com] Tag: Dropdown Grid Tag: 51928
Possible ToolBar bug
The following Form-derived class illustrates a problem I
am having when a ToolBar is instanced at the bottom of a
Form with a simple Panel at the top. When this form is
minimized and then restored, the layout logic leaves the
Panel not fully occupying the available client area. The
amount of dead space at below the panel depends on the
number of buttons instanced on the ToolBar. If no buttons
are used, the layout is correct.
Any ideas?
==============Form1.cs===================================
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace WindowsApplication2
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.ToolBar
toolBar1;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.ToolBarButton
toolBarButton1;
private System.Windows.Forms.ToolBarButton
toolBarButton2;
private System.Windows.Forms.ToolBarButton
toolBarButton3;
private System.Windows.Forms.ToolBarButton
toolBarButton4;
private System.Windows.Forms.ToolBarButton
toolBarButton5;
private System.Windows.Forms.ToolBarButton
toolBarButton6;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container
components = null;
public Form1()
{
//
// Required for Windows Form
Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code
after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool
disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose
();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated
code
/// <summary>
/// Required method for Designer support -
do not modify
/// the contents of this method with the
code editor.
/// </summary>
private void InitializeComponent()
{
this.toolBar1 = new
System.Windows.Forms.ToolBar();
this.panel1 = new
System.Windows.Forms.Panel();
this.toolBarButton1 = new
System.Windows.Forms.ToolBarButton();
this.toolBarButton2 = new
System.Windows.Forms.ToolBarButton();
this.toolBarButton3 = new
System.Windows.Forms.ToolBarButton();
this.toolBarButton4 = new
System.Windows.Forms.ToolBarButton();
this.toolBarButton5 = new
System.Windows.Forms.ToolBarButton();
this.toolBarButton6 = new
System.Windows.Forms.ToolBarButton();
this.SuspendLayout();
//
// toolBar1
//
this.toolBar1.Buttons.AddRange(new
System.Windows.Forms.ToolBarButton[] {
this.toolBarButton1,
this.toolBarButton2,
this.toolBarButton3,
this.toolBarButton4,
this.toolBarButton5,
this.toolBarButton6});
this.toolBar1.Dock =
System.Windows.Forms.DockStyle.Bottom;
this.toolBar1.DropDownArrows =
true;
this.toolBar1.Location = new
System.Drawing.Point(0, 407);
this.toolBar1.Name = "toolBar1";
this.toolBar1.ShowToolTips = true;
this.toolBar1.Size = new
System.Drawing.Size(696, 28);
this.toolBar1.TabIndex = 0;
//
// panel1
//
this.panel1.BackColor =
System.Drawing.SystemColors.Info;
this.panel1.Dock =
System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new
System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new
System.Drawing.Size(696, 407);
this.panel1.TabIndex = 1;
//
// Form1
//
this.AutoScaleBaseSize = new
System.Drawing.Size(5, 13);
this.ClientSize = new
System.Drawing.Size(696, 435);
this.Controls.Add(this.panel1);
this.Controls.Add(this.toolBar1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the
application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
}
} Tag: Dropdown Grid Tag: 51927
Win98: DragDrop registration fails everytime
I'm ripping a thread that I created a few days ago, since I used the
exact same subject line as a previous one.
In addition, I can also say that since I posted this thread, I've come
to the conclusion that this application is hitting some sort of wall
with regards to Window handles. I'm leaning towards this being one of
the primary issues because when a user selects a "tool" from a Form
(it launches the core application, which is quite large), you can
immediately kill the Form, go back to the tool selection Form...select
it again, and it will _always_ fail to load the 2nd time. The
application just dies.
Furthermore, I've got try/catch blocks all over the place, sending the
Exceptions to a logfile, and nothing ever gets logged once it gets in
this state. You're forced to do the ole' Win98 CTRL-ALT-DEL at that
point.
So, the question is this: If I'm correct (or partially) in that Window
handles might be the culprit, how do I resolve it? I spent an entire
day forcing dispose() on everything I could possibly think of, as well
as using things like the Performance Counters to identify problematic
(meaning, resource hungry) classes, and I still get the same result...
Can anybody (Microsoft?) help or even give me some kind of direction?
Here's the original post...
-----------------------------------------------------------
I have a C# Application that is posing some interesting issues when
run within Win98. Let me preface this by saying that everything works
like a charm under Win2000.
Anyhow, the current issue is that under "certain" circumstances
(there's no logic as to how/why this happens), you will fire up this
application under Win98 and get a "DragDrop Error: registration
failed" MessageBox from JIT.
The source code line in question is, of course, a simple
"this.AllowDrop = true;" property. If I were to remove it, the problem
would go away. Of course, I need that call in order for the
application to function correctly.
And before anybody asks the obvious, I _do_ have the following line in
my main Form:
[STAThread]
static void Main(string[] args)
I can't really make heads or tails out of this issue, and it
definitely presents itself only under Win98.
This particular Win98 machine is up to scratch, in terms of
patches/updates/etc. The OS has IE6.0 installed, as well as .NET
runtime v1.1. The Application is compiled using .NET Studio 2003.
Can anybody shed any light on this? Any workarounds? Tag: Dropdown Grid Tag: 51926
User control shows error
hi,
I have a Windows Form (in VB.NET) with a panel that
includes a User Control that I have made.
It used to work fine, but now, I have the following
problem:
The programs compiles and works fine.
But when I look at the form in DESIGN VIEW,
it does not display the UserControl, but the following
error message: Object Reference not set to an instance of
an object.
Any idea why I have this???
thanks,
Ross Tag: Dropdown Grid Tag: 51919
Inherited Forms Lose Tab Order
1.) Create a form with a tabcontrol.
2.) Change the modifier of the tab control to "protected"
3.) Add 1 tab to the tab control.
4.) Create a second form that inherits from the first.
5.) On the new form, add a 2nd tab to the inherited tab
control.
6.) Swap the order of the tabs so the new tab occurs first.
7.) Save and close the forms. Re-open the 2nd one.
Notice the tab order was not preserved.
Bug? Workaround? Tag: Dropdown Grid Tag: 51918
CustomEditor on collection for a component
I'm trying to use a custom editor for a property in a
component. The custom editor shows a dialog. It appears
the custom editor is not calling the SET property when its
done. I've tested this with other samples and it does
there. Could this have anything to do with the fact that
the type of the property is an ArrayList?
Bill Tag: Dropdown Grid Tag: 51917
Setting Application directory as path for database.
I want to set my application's database path to the
directory that the application resides in so that any
location I install this application will look to the
installation directory, instead of where I have the file
located on my system. (ie C:\Documents and
Folders\Users\Current User...)
I am setting this at design time using the properties
window for the OleDb connection. Can I do this? If not how
do I do it? Tag: Dropdown Grid Tag: 51906
Validation + Malicious input
Hello All,
I am currently developing a windows form which transacts
data with a database, using web services.
These transactions are the heart of the application, as
98% of the tasks allowed on the UI bind to the web service.
Due to the implicit need of assuring the user does not
enter wrong data (SQL Data Types) or INJECTS malicious
code, where can I find good information on windows forms
data validation->(priority 1) and avoiding malicious code
avoidance->(priority 2)?
- The big question is: is there something like a
asp:InputValidator on WindowsForms, or do I have to deal
with it down to the nitty gritty?
Thanks for all the replies, any resources are welcome
Francisco Tag: Dropdown Grid Tag: 51904
How to handle System menu messages?
I have a MDI Parent in which I display a dialog box. When user minimize the
dialog I want the whole MDI window to be minimized.
Your help greatly apreciated.
Thanks,
Hemanshu Tag: Dropdown Grid Tag: 51889
DataGrid font
How do I change the font for a single cell of a data grid?
Want to make the current font BOLD when the value in the
underlying dataset exceeds a threshold value....datagrid
is readonly, non-sortable columns, so the one-to-one
relationship is well-defined.
At minimum, would want to make all cells of a given column
in bold.
Thanks. Tag: Dropdown Grid Tag: 51885
Using a JAVA / JSCRIPT APPLET
I have a JAVA APPLET (below) that I'd like to us in a WindowsForm, But
I'm not quite sure where to begin with this one. Any help to get me
in the right direction would be appreciated. Thanks in advance.
<APPLET name="cvcs" CODEBASE="http://192.168.1.199:80/"
CODE="xplug.class" WIDTH=320 HEIGHT=240>
<param name="RemotePort" value=8481>
<param name="Timeout" value=5000>
<param name="RotateAngle" value=0>
<param name="PreviewFrameRate" value=2>
<param name="DeviceSerialNo" value="RnJvbnQ6c3RlYzAx">
</APPLET> Tag: Dropdown Grid Tag: 51882
HelpProvider bug? Close the .CHM window and application closes too!
Has anybody else seen this?
I have a Windows Forms application that simply uses the HelpProvider control
to open a .CHM. I use the helpprovider.show method and it works fine.
However, when the Help window (*.chm) opens, if I quit (i.e. close) the Help
window, then it closes as expected, and so does my application! ??
This isn't supposed to happen is it? how do I overcome this so that when I
close the Help window, my application stays open and running?
I am using VB.NET, with Visual Studio 2003 with all the latest .NET
Framework revisions etc.
Thank you. Tag: Dropdown Grid Tag: 51879
Root node in Treeview without sign (+/-)
Hi
Does anyone know how to show the root node in a treeview
control without the signs in front?
Thorgeir Tag: Dropdown Grid Tag: 51877
Windows forms datagrid - Totals row
Any ideas for a best approach on how best to achieve this? (the footer is
what i'd use in the ASP.NET Datagrid... (which is many ways is much better
than the windows forms datagrid, which is strange if you think about it ! ))
Thanks Tag: Dropdown Grid Tag: 51875
Click event prevent DoubleClick from firing
Hi,
When using a form ,Click event is preventing DoubleClick from firing.
Anyone familiar with this behaviour?
how can i capture both event seperatly?
thanks
erez Tag: Dropdown Grid Tag: 51873
Close Form
Hi,
I want to stop my Forms-Application from the constructor=20
of the form-class.
I try to make some connections in the constructor. If=20
there are some erros
I want to stop the application.
Now I tried a few thinks:
this.Close();
which has no effect, because the Form is not open in the=20
constructor.
The form opens.
Application.Exit();
has also no effect. The Form still opens.
System.Threading.Thread.CurrentThread.Abort();
=09
throws an exception which I can=B4t catch.
How can I stop my program in the constructor without any=20
errors ?
Thanx and regards=20
Stephan Tag: Dropdown Grid Tag: 51872
LinkLabel Column in Datagrid
Is it possible to have a link label column in a datagrid
if so kindly help me out with explanations or sample codes
Thankx in advance Tag: Dropdown Grid Tag: 51870
Few questions regarding building MSI using VS.NET
Hi,
I am building MSI for my projects using Visual Studio.NET and facing some
problems with this.
1) I want to add a shortcut to another EXE which is not included in the MSI.
How to add this? Visual Studio.NET allows us to create a shortcut for files
that are included in the project / MSI whereas WISE allows to do the same.
2) When we create the MSI using VS.NET, the default setting for installation
is to install "only for the you" but not for "anyone who uses the computer"
( you can see this option in "User information" dialog while installing any
MSI. I could not find any place in VS.NET setup project to change this
option. This is very essential to assign the MSI using Group Policy. How to
change the default option?
3) Is it posible to change the dialogs and to add any custom actions?
Any Help??
Advance thanks,
Ramana Tag: Dropdown Grid Tag: 51867
Program the function key of Datagrid
How to program the function keys(right arrow, left arrow,
Up arrow, down arrow, tab, PgUp, PgDn) of datagrid? Tag: Dropdown Grid Tag: 51864
ListBox Performance - SetSelected
Hi there,
I have the case where I am trying to optimize some slow code that selects
listBox items.
For approximately 6,500 items, the IndexOf method takes about 3 seconds on a
2.4GHz machine, and SetSelected takes about 9 seconds.
The label lookup from the lable map takes about 0.004 seconds.
Is there any way of selecting items in a quicker, possible batch fashion?
SelectedIndices appears to be read only. Surely it can't take 9 seconds to
select all these indexes when only 10 or 12 are displayed at any one time.
I've tried SuspendLayout() and ResumeLayout() to try to avoid code that
updates the display after every selection, but the performance remained the
same.
for(int i = 1; i <= aenumElements.Count; i++)
{
string alabel = m_idLabelMap[aenumElements[i]] as string;
int aindex = listBoxElements.Items.IndexOf(alabel);
if(aindex >= 0)
listBoxElements.SetSelected(aindex, true);
}
Any tips would be greatly appreciated (short of re-working the use case to
not require 6,500 elements of course).
Thanks,
Wayne. Tag: Dropdown Grid Tag: 51863
can we call function whose name store in variable
Hi All,
Is it possible to call a function whose name is store in variable using
VB.Net. Assume this
dim a as string
a = "GetEmployee()"
Now I have function name in a variable, how can I call this function that is
already define.
Thanks
AQ Tag: Dropdown Grid Tag: 51861
Client/Server Samples with Business Logic Layer
Sorry for the cross-post, but I didn't know whom to ask..
Are there any samples for a true C/S app (preferably VB, but C# is welcomed)
with a middle tier using datasets/datatables similar to the the Fitch/Maher
sample w/VB6? The only thing i can find on windowsforms.com & MSDN is
TaskVision, which is overly complicated for my needs(dont need to expose
data via web services).
I have adopted the "MS Building Blocks" data access class, but it's only
been used in ASP.Net samples, and would like to continue using it in the
BLL. Is this possible?
Thanks,
Morgan Tag: Dropdown Grid Tag: 51844
Disable MDI Scrollbars
Hi all!
Relating to an earier post I made.
I tried the EnableScrollBar API which didn't seem to work
for me. This is how I'm declaring it:
[ DllImport("user32.Dll", EntryPoint "EnableScrollBar") ]
public static extern bool EnableScrollBar(System.IntPtr
hWnd, int wSBflags, int wArrows);
Then using it like so:
EnableScrollBar(this.Handle, 3, 3);
If anyone has any success in disabling MDI parent
scrollbars then I'd love to know how you've done it!
Thanks,
Carl Tag: Dropdown Grid Tag: 51843
Is it true that Windows Forms don't use config files?
WROX's "Professional ADO.NET" makes the following statement on page 54 when
discussing obtaining connection strings from a config file:
"In Web applications this file must be name web.config. In Console
applications, the configuration file also ends in .config, but is prefixed
with application name, such as MyApp.exe.config. Windows Forms applications
do not use configuration files."
I am curious why Windows Forms do not use config files and also what about
Windows Service apps (or they treated as "console" apps?)? Tag: Dropdown Grid Tag: 51842
Inherited Control Location
I have an inherited form that has 2 broup boxes and 2 controls (textboxes)
on each group box. I am unable to move controls out of the group box. Is
this an inherited controls issue, or am I missing something else? Tag: Dropdown Grid Tag: 51839
Datagrid: Full Row Select and Other Options like in TaskVision
All,
Maybe I'm just missing it but how do you do the following three things
with a WinForms DataGrid...
1: Make it so when the user clicks on any part of a row the FULL row
becomes selected
2: Hide the add new row from the bottom of the grid
3: Remove the grey side bar from the left of the grid
For an example see the main grid in the TaskVision Demo at:
http://www.windowsforms.net/default.aspx?tabIndex=7&tabId=44
This is the EXACT grid I want. I took a look at the source and I can't seem
to find where they made the tweaks.
The dgGrid is of type System.Windows.Forms.DataGrid so it is still the basic
grid.
I'm pretty sure it is something from the class "public sealed class
MainFormDgStyle" but I can't seem to find what.
-Jason Tag: Dropdown Grid Tag: 51836
databinding lose focus
Hi, I was wondering if someone could give me a workaround for this...
I have a windows form with a number of text boxes that are databound
to a datatable. My problem lies in the fact that (to the best of my
knowledge) you must tab off of the control (ensure it has lost focus)
before it will update the datarow with the information that was typed
in the textbox.
This is an issue because I give users the option to 'save & close' the
form from a menu item, and menu's are specifically designed not to
accept focus - thus focus never leaves the control the user was last
typing in, therefore the last controls contents never make it back to
the datasource.
I've tried removing focus from the control programatically as part of
the 'save & close' function, but this doesn't seem to work.
Any ideas?
Cheers,
Matt Tag: Dropdown Grid Tag: 51835
Multilanguage Keyboard
Im trying to create an onscreen keyboard onto one of my
forms. How do i take into consideration different
languages keyboard layouts (I want to be able to support
multiple languages).... for example where the "Q" key is
on an english keyboard on a French keyboard it is the "A"
Please any help will be greatly appreciated...
Thanks, Tag: Dropdown Grid Tag: 51834
Adobe fonts don't show up in fontdialog
Does anyone have any exp with getting the adobe fonts to show up in the
fontdialog?
If I paste text from word into a .Net RTF I can retain the font in the RTF
(it looks correct on the scree and it prints correctly), but I can't show
the correct font in the font dialog.
Help Tag: Dropdown Grid Tag: 51833
Set the focus with multiple panels
Hi,
I have a win form wich is composed of multiple panels (all
visible). In one of the panel, I have a UserControl that I
have made.
When the form gets loaded, I want to have the focus in a
Textbox inside the UserControl (which is inside a panel).
I used:
MyForm.MyUserControl.myTxtBox.Focus()
but it doesn't work: the boolean value returned by this
function is false!
Any idea of what I need to do?
thanks,
Jenny Tag: Dropdown Grid Tag: 51832
Have anyone seen or implemented a control that drops a
grid out of dropdown list box?