Strange exception in windows forms
Hello,
In windows applications I sometime get this starnge exception:
System.ObjectDisposedException: Cannot access a disposed object named "q".
Object name: "q".
at System.Windows.Forms.Control.CreateHandle()
at System.Windows.Forms.Control.get_Handle()
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.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)
It never happens on development computers only on clients.
I don't have object named "q".
Does anybody has any idea what may lead to this exception?
Thanks
Mark Tag: Parental Filter Tag: 81245
InputBox in VC#.net?
In VB, we have InputBox to allow a user to input text. Do we have a similar
one in VC#.net? Obviously, MessageBox can not do it.
Thanks. Tag: Parental Filter Tag: 81242
XP Themed Selection Rectangle for Listview Control
Does anyone know how to get that blue selection rectangle that is in the
windows explorer Listview control. In my listview controls it is just a
dotted focused rectangle.
Etan Bukiet Tag: Parental Filter Tag: 81241
Looking of Free and facny treeview control
I am looking for fancy shareware treeview control like one available from
Softeldvm.com (costs $500). Does anyone know?
--
Thanks for your help.
Harshad Rathod Tag: Parental Filter Tag: 81240
OnKeyDown in modeless form
I have an application that displays a modeless form. On this form i
want to trap certain keys. For example ctrl-right, ctrl-left, ...
I have these keys already working on the main form of my application,
but know i need to trap them in a seperated modeless form, but the
onkeydown event is not being fired.
How do i go about trapping these keys. Tag: Parental Filter Tag: 81239
Multiple minimize and maximize buttons appering on MDI menu contro
Below is text of the simillar problem we are facing allready posted by
another user on the net...
I have created an MDI application. When the first child form is opened and
maximized one set of minimize, restore and close buttons are displayed on the
menu bar. After closing the child window a set of minimize, restore and close
buttons remain even though the child form has been closed.
EXAMPLE:
http://novasolution.net/Error2-2.jpg
When a second set child form is opened and closed a second set of minimize,
restore and close are shown on the menu bar.
Each time a child form is opened and closed, another set of controls appears
on the menu bar. When I open a new child form the multiple sets of buttons
disappear. When the child form is maximized, only one set of buttons displays
in the menu bar. When the child window is closed another set of buttons is
displayed on the menu bar.
some how we are unbale find a solution to this problem..
Any ideas..
Example Tag: Parental Filter Tag: 81234
Forms pseudo MDI support
While trying to implement a MDI Application I found that the Windows.Forms
classes that implement this functionality don't actually use the WIN32 MDI
API.
Using Spy++ I found that the MdiClient class does not use the 'MDICLIENT'
window class. I also hooked up a Messagefilter to look at the MDI messages
send to the mdiclient, the only messages I saw were WM_MDISETMENU and
WM_MDIREFRESHMENU.
Can anyone confirm this or does anyone know why this was done? Tag: Parental Filter Tag: 81233
UPDATE SQLTABELLE
VS2003 C#
Ich habe einen SQLDATAADAPTER erstellt und ein DATSET generiert.
Diese Dataset stelle ich in einem DATAGRID dar.
In der Tabelle ist das Feld UKID als Primärschlüssel definiert und damit
werden keine Nullwerte zugelassen.
Num füge ich im DATAGRID einen Satz hinzu und update den
SQLDATAADAPTER(DATASET).
Die neuen Sätze stehen in der SQl-Tabelle.
Nun möchte ich aber im DATAGRID das Feld UKID (Primärschlüssel) nicht mit
anzeigen und somit
bei kann ich bei einem neuen Satz auch keinen Wert im DATAGRID dafür
eintragen.
Betätige ich dann den Button zum Update des SQLDATAADAPTERS
erhalte ich folgende Fehlermeldung "Spalte UKID läßt keine Nullen zu ..."
Wie kann ich dem Feld UKID einen Wert im Code zuweisen, damit ein neuer Satz
im DATAGRID
akzeptiert wird?
Das heist, der Nutzer soll bei einem neuen Satz im DATAGRID nicht die UKID
eintragen können,
die soll im Programmcode mit einem Wert belegt werden.
Mit freundlichen Grüßen
Hendrik Petzold Tag: Parental Filter Tag: 81232
Control layout problem with system large fonts
I have seen many people stating that they have the same problem.
I have the font DPI setting set to 125% normal size (from the Display
Properties dialog when you right-click on the Desktop). If a Windows
Form is more than simle (has many controls), then the most chance is
that when the Form is shown in runtime, the layout is somewhat in right
condition (Some controls might position beyond the visible client area).
I am not sure if Microsoft noticed this problem. I think it is a very
*BAD* problem, based on that Microsoft/Windows have been strong in user
friendly GUI since their beginning.
My $0.02. Tag: Parental Filter Tag: 81231
Threading
Hello,
I am making a app that creates a thread to show a clipboard. If the
clipboard is double clicked, another window is displayed, the event is
handled inside the main app. What I would like to do is have the clipboard
use the main thread of the application that called it to handle the new
window. Is this possible and if so how would this be accomplished.
ie.
Form1 creates a thread and the thread displays Form2.
Form2 when double clicked raises an event that creates a new form (Form3).
The event is handled inside Form1.
How can I get Form3 to be managed by the main thread (Form1)?
Thanks,
Chuck Tag: Parental Filter Tag: 81225
thread safety
Can anyone suggest a good (cheap) tool that will detect when a worker thread
calls directly in to a control on the UI thread?
Thanks for your help
Graham Tag: Parental Filter Tag: 81220
Auto Expanding TextBox/Controls
Hi there,
I've googled this problem, and not found a suitable solution yet. I was
wondering if anyone has made any progress?
Basically, I want to make a textbox automagically adjust it's height to show
all the text it contains. So, if I add text then it grows, and it shrinks if
I remove text. This is similar to the CanGrow property in MS Access
controls.
I'm willing to purchase a control if anyone knows of any, I'd just like to
get this cracked without spending *too* much time "fiddling" about!
Any help much appreciated
Tobin Tag: Parental Filter Tag: 81217
Add user control to winforms Toolbox
I created a user control which I signed and added to GAC. Users add the
control to the toolbox by navigating to the dll.
However when they drag and drop the control from the toolbox onto the
winform they get an error, which basically means they need to manually add
references to other dlls which are referenced by my user control dll.
Is there a solution to this? Thank you Tag: Parental Filter Tag: 81214
using the modem directly
hi
I need my Win App to connect with my WS
But when the App need to stablish a connection I want it to be transparent
to the user
MyQuestion:
How can I use the modem directly passing the phone number etc from the win
app?
I dont want the Dialup networking windows to apear neverr.
any sug
--
Kenny M. Tag: Parental Filter Tag: 81213
Transparent control
Hi,
I have to write transparent control - simple red rectangle. When I mouse
move control should change position(left and top). The problem is when
red rectangle is moving over other controls such Buttons, PictureBoxes
it flicker.
Below is code of rectangle control :
public class TransRectangle : System.Windows.Forms.UserControl
{
public TransRectangle()
{
InitializeComponent();
}
protected override CreateParams CreateParams
{
get
{
CreateParams cp=base.CreateParams;
cp.ExStyle|=0x00000020; //WS_EX_TRANSPARENT
return cp;
}
}
//Override the OnPaintBackground event. This is ecessary //to
prevent the background to be painted.
protected override void OnPaintBackground(PaintEventArgs e)
{
// do nothing
}
protected void InvalidateEx()
{
if(Parent==null)
return;
Rectangle rc=new Rectangle(this.Location,this.Size);
Parent.Invalidate(rc,true);
}
protected override void OnMove(EventArgs e)
{
this.InvalidateEx();
Graphics g = this.CreateGraphics();
g.DrawRectangle(Pens.Red, 0, 0, this.Width - 1,
this.Height -1);
g.Dispose();
}
protected override void OnPaint(PaintEventArgs e)
{
e.Graphics.DrawRectangle(Pens.Red, 0, 0, this.Width - 1,
this.Height -1);
}
protected override void OnMouseMove(MouseEventArgs e)
{
this.Left += e.X;
this.Top += e.Y;
base.OnMouseMove (e);
}
public void pInvalidate()
{
this.InvalidateEx();
}
}
Regards,
Olo Tag: Parental Filter Tag: 81208
User Control's Load event fires when the Dispose method executes
I have a user control which is used as a data entry form and it is
instantiated on a window form. When the windows form is closed via clicking
on the top right red-X close button, the user control's Dispose method
executes. When it executes the load event fires.
Here's the dispose method:
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
'WHEN THE NEXT LINE EXECUTES, the controls Load Event Fires.
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
This user control also created instances of some other user controls used as
sub-forms. I don't know if this has anything to do with it, but when the
user clicks on the red-X close button of the parent form and things began
to close, no cleanup code ran to kill the instances of these user controls.
I will eventually have the proper cleanup code in place, but right now I
want to understand why this load event fires when "components.Dispose()" is
called.
Thanks.
--
moondaddy@nospam.com Tag: Parental Filter Tag: 81204
Post-Mortem Debugging
Does anyone have advice about ways to obtain information about errors
that occur in Windows Forms applications at a user site? I am
currently sending exception.ToString back to me. I am not
distributing the .pdb files for size reasons so I do not get line
numbers in the stack trace. I have researched mini-dumps but have not
been able to find a good solution for using mini-dumps in a fully
managed application.
I would appreciate any advice or links to information.
Kerry Jenkins Tag: Parental Filter Tag: 81201
DateTime Bound to TextBox
Hi,
I have bound a DateTime field in a DataTable to a TextBox field. Other
String and Numeric fields are also bound to separate TextBoxes. If a new
DataRow is created and a DateTime value is entered no problem. However,
after the row is saved, I am unable to clear the date from the textbox.
I do not have this problem when binding to a DataGrid. But a DataGrid is
far from user friendly and just plain impractical in many situations.
In its place I am loading the DataRow into a class and using unbound fields
on the form. Bound controls seem great for strings. But thats about it.
Does anyone have a better solution?
Thanks Tag: Parental Filter Tag: 81194
Is there any way to stop autoscroll to modify autoscrollpos value
hi all am using a panel , now i want to programitally set the
thumb of autoscroll. for tht i have override wndproc()
and try to set it .. ant it does ..
but after that autoscroll too modify value of autoscrollpos
..
for ex say i make auotscrollpos to 30 . then after the call
is over , it becomes say 40 .
wht to do pls help
--
amit bharadwaj Tag: Parental Filter Tag: 81193
How to simply load a freeekin bitmap from a resource?
I'm coming over from a background in VC++, and in general I've been
pleased with the simplicity of the .NET environment. Not here.
I've done google searches on this subject (loading bitmaps from a local
resource) and always come up with complex solutions. This can't be right.
Everyone packs bitmaps and other graphics and resources, integral to small
executables, right?
Setting up a local resource folder, loading in graphics, and setting their
properties to 'Embedded Resource' would seem to incorporate them, as
expected.
Then what? It's tough to make 'FromResource' happy. There's got to be
some simple solution to this. Tag: Parental Filter Tag: 81191
Help MDI Child forms move smoothly?
Again, I'm writing a smart client application using VB.NET. I've been
writing web applications for the last few years and am new(ish) to
Windows Forms programming using .NET.
I have some MDI forms that move smoothly when being dragged and others
that don't refresh/aren't redrawn nearly as well when being dragged.
I've no idea what causes the difference in behaviour. Any idea what
might cause the latter?
Thanks
Daft.Geezer Tag: Parental Filter Tag: 81189
Problem with the scroll position of the Windows panel control
Hi all,
i am currently developing an application in which i am using the
windows panel control.
the panel controls contains lots of User controls which are populated
dynamically in the same. and also i have set the auto scroll postion
of the panel control to true.
but the problem is that, whenever i minimize the forms, i just loose
my scroll position. the scroll get shefted to the control which has
the focus.
can any body help me out how can i maintain my scroll position
Thanks
Vikash Tag: Parental Filter Tag: 81186
Cannot create dataset with wizard
I just loaded vb.net and haven't been able to create a dataset using the
wizard. I get the eror message: "There were problems generating dsMyDataset.
To resolve this problem build the project, fix any errors, and then generate
the datatset again."
I'm out of ideas... Tag: Parental Filter Tag: 81182
Deployed simple C#.NET single form application to Windows server 2003 and the form will not display, but application appears in the the task bar.
I have a very simple C#.NET (Framework 1.1) application that is one form
with standard .NET controls on it. The application requires a CONFIG file
to work. When I install the application to Windows 98/2000/XP, I simply
install the .NET framework and copy the EXE and CONFIG files to the
workstation and double-click the EXE. This has worked fine for those
Operating Systems. When I deployed this to a Windows Server 2000 machine, I
just needed to do the same to get it to work (.Net was already installed).
However, when I copy the EXE and CONFIG file to the Windows Server 2003
machine and double click the EXE, the form does not display any User
Interface (the single form), however, an application block appears in the
Task Bar (toolbar that contains the start button and system tray). I do not
know what is causing this, and I have no idea how to fix this. I have
searched the Microsoft Knowledgebase and googled some searches, but have
found no information that has been helpful. I have tried to use the
"Microsoft .NET Framework 1.1 Configuration" tool, but no luck. Any ideas
or suggestions?
Thanks,
Roger Tag: Parental Filter Tag: 81169
ScrollableControl Scrolling by Itself
I have a UserControl with AutoScroll set to true. When my application loses
then regains focus, the control scrolls itself to make ActiveControl visible.
This also happens when I dynamically add or remove child controls. Is there
any way to make the scrollbars stay put?
Here's some sample code demonstrating my problem. Run the application then
scroll down and right as far as possible. Button one will be scrolled out of
view and button two will be visible. Switch to another program then come back.
The scrollbars will move to make button one visible again.
----
using System;
using System.Windows.Forms;
using System.Drawing;
public class TestScroll
{
public static void Main(string[] args)
{
Application.Run(new TestForm());
}
}
public class TestForm : System.Windows.Forms.Form
{
public TestForm()
{
this.ClientSize = new System.Drawing.Size(400, 400);
this.Text = "TestForm";
container = new ContainerControl();
container.Dock = DockStyle.Fill;
container.AutoScroll = true;
this.Controls.Add(container);
btnTest1 = new Button();
btnTest1.Left = 0;
btnTest1.Top = 0;
btnTest1.Width = 50;
btnTest1.Height = 50;
btnTest1.Text = "One";
btnTest1.Click += new EventHandler(this.OnBtnClick);
container.Controls.Add(btnTest1);
btnTest2 = new Button();
btnTest2.Left = 500;
btnTest2.Top = 500;
btnTest2.Width = 50;
btnTest2.Height = 50;
btnTest2.Text = "Two";
btnTest2.Click += new EventHandler(this.OnBtnClick);
container.Controls.Add(btnTest2);
}
private void OnBtnClick(object sender, EventArgs args)
{
container.ActiveControl = (Control)sender;
}
private ContainerControl container;
private Button btnTest1;
private Button btnTest2;
}
----
Apologies if this is a common question. A quick Google search shows that
it's been asked before, but I didn't find any answers.
Thanks,
Ravi. Tag: Parental Filter Tag: 81168
find process by processname
I wanted to find a process by the ProcessName property, but I discovered
that if the executable name changes, the ProcessName reflects that. Is
there some way for me to identify a process by something that may not
change? Tag: Parental Filter Tag: 81166
Creating VS Studio like control
How do you create controls like Toolbox and Solution Explorer that expands
OnMouseOver and lsides back when looses focus? Also, it has bookmark.
--
Thanks for your help.
Harshad Rathod Tag: Parental Filter Tag: 81163
creating VS Studio like controls
How do you create controls like Toolbox and Solution Explorer that expands
OnMouseOver and lsides back when looses focus? Also, it has bookmark.
--
Thanks for your help.
Harshad Rathod Tag: Parental Filter Tag: 81162
Setup project and Windows 2000
I have a Windows Forms .NET application that I've built a Setup project for
that includes the installation of the .NET Framework and MSDE (using the MSDE
Deployment Toolkit). The install & uninstall works fine when the O/S is
Windows XP. The installation works on Windows 2000 as well, but the
application doesn't appear in the list in "Add/Remove Programs" so that it
can be uninstalled. What am I missing?
Thanks in advance! Tag: Parental Filter Tag: 81161
Hidding a window and preventing Alt-Tabbing to it
I'm trying to hide the main form of my application, as I want all of the
user interaction with my application to come from interacting with a notify
icon with a context menu in the system tray (which I have working). I've
figured out how to hide the form easy enough, set the WindowState to
Minimized and ShowInTaskbar to False.
What I can't figure out is how to prevent the user Alt-Tabbing to the
window, as its still visible in the Alt-Tab menu. I can set the windows
FormBorderStyle to FixedToolWindow or SizeableToolWindow and it will no
longer show up in the Alt-Tab menu but now it will now minimize to the
bottom left of the desktop just showing the windows title bar instead of
being completely hidden!
Does anyone know of any way to completely hide a window visibly(so no part
of the window is visible anywhere), with no icon on the task bar or on the
Alt-Tab menu? All I really want is to be able to run a notify icon in the
system tray and a context menu for the icon but I'm don't know of any other
way to do it other than to run it in a enclosing form.
I've been wondering if making my application a service make things easier
but I've no experience with programming services and it seems a bit of
overkill for what I'm wanting to do!
Any advice would be most appreciated!
Cheers,
Danielb Tag: Parental Filter Tag: 81159
Hello, Japan?
My application is so successful that it needs to go global.
The only problem is that that means Japanese. I don't know the first thing
about making a Japanese language application. I know I have to use Unicode,
but that's about it.
In case it matters, the user will be presented with a dialog, and he can
choose, dynamically, which language it should be rendered in. So, it isn't a
matter of linking a particular resource file for Japanese on one machine, and
a different one for English on a different machine. Both must be available,
based on user choice.
Is there a simple "Hello, World" application for the .Net framework, but in
Japanese? Or any sample applications that make use of Japanese? I don't
even know where to find a Japanese font.
Any help would be appreciated. Tag: Parental Filter Tag: 81155
Closing all instances of an application
I start up several instances of an application I've written. From one of
the applications I'm trying to close all of them, but it's not working. I'm
doing this by registering a message and broadcasting it. but when I put a
breakpoint in my overridden WndProc, It never seems to get the message.
public class frmMyApplication : System.Windows.Forms.Form
{
public const int HWND_BROADCAST = 0xFFFF;
[System.Runtime.InteropServices.DllImport("user32.dll")]
public static extern int RegisterWindowMessage(string strMessageType);
[System.Runtime.InteropServices.DllImport(strUSER32DLL,
CharSet=CharSet.Auto, SetLastError=true)]
public static extern int SendMessage(IntPtr
hWnd,[MarshalAs(UnmanagedType.U4)] int iMsg, int iWParam, int iLParam);
int iCloseAllMessage_m;
public frmMyApplication()
{
iCloseAllMessage_m = MediScript.RegisterWindowMessage("_CloseMyApps");
if (iCloseAllMessage_m == 0)
{
throw new Exception("RegisterWindowMessage returned 0");
}
}
protected override void WndProc(ref Message m)
{
if (iCloseAllMessage_m != 0 && m.Msg == iCloseAllMessage_m)
{
Application.Exit();
}
else
{
base.WndProc (ref m);
}
}
private void mnuiCloseAll_Click(object sender, System.EventArgs e)
{
SendMessage((IntPtr)HWND_BROADCAST, iCloseAllMessage_m, 0,0);
}
} Tag: Parental Filter Tag: 81154
Obtaining system appearance settings.
How do I find out what the Systems's appearance parameters are such as the
window border width or color? Tag: Parental Filter Tag: 81152
Maximize
Hello,
I have an application that starts notepad.exe from a button click in VB.NET.
I am looking for a way to make the window maximize or minimize from the vb
app.
Any suggestions (if at all possible, detailed) will be greatly appeciated,
Thanks,
Chuck Tag: Parental Filter Tag: 81149
GroupBox disables event handlers in the user control it contains.
Hi, friends,
In my VC# windows program, when I put a user control in a GroupBox, all the
event can no longer be handled, for example, DoubleClick. However, if I
remove this GroupBox and put the same user control in the Form directly,
everything works fine.
I do not know what is wrong here. Any ideas? Thanks a lot. Tag: Parental Filter Tag: 81148
Excel Add-In InvalidCOMObjectException On Shutdown
Hi Guys,
I've created an Office.CommandBarPopup Add-In for Excel that launches a
Windows Form as a modal dialog when a button within the CommandBarPopup is
clicked.
However, when Excel is shut down I am receiving an InvalidCOMObjectException
error. This is even happening even though the form has no embedded controls.
It doesn't happen if the dialog isn't instantiated.
Is there a procedure that needs to be followed when destroying forms from
Excel add-ins?
Best regards,
Jim... Tag: Parental Filter Tag: 81144
Monitor Dial-up Connection
I am writing a smart client application that needs to monitor the users
dial-up connection status. If the user disconnects, I need to prompt them to
reconnect, or quit the application. I tried using the following WMI query
wmiDialupDisconnect = New ManagementEventWatcher("SELECT * FROM
MSNDIS_NotifyAdapterRemoval")
but it does not work. Does anyone have any ideas how I can monitor a users
dial-up connection status? Tag: Parental Filter Tag: 81143
Panel & keyboard focus
I have a panel and some of my controls on it (each control is derived from
Control, not from UserControl). I need to delete the selected control by
pressing the Del key. How it can be done? Panel does not process any
keyboard events. Also I don't want to delete any controls when focus is on
the other controls of the form.
So the scenario is something like this:
1. User clicks on some of my controls (panel receives focus)
2. User press Del key (control removes from panel)
3. User press Tab key (the focus is received by another control of the form,
but not a control of the panel)
4. User press Del key (nothing happens)
So the main question is how can I monitor focus state of the panel and
process the keygboard input?
Thank you very much.
--
With best regards,
Mikhail Tag: Parental Filter Tag: 81138
creating instance of a form from a variable
Ususally we do like:
SalesOrderForm fm = new SalesOrderForm();
where SalesOrderForm is a valid form in one of the assembly, that is
SalesOrderForm is a type. How can I create an instance of SalesOrderForm
when I do not know its type at run tyme? For example
public openForm (string formName)
{
// here I might get "SalesOrderForm" or something else. If I get
"SalesOrderForm" then I want to open it.
Here, it will also be NOT known which assembly this for is in.
}
Thanks.
--
Thanks for your help.
Harshad Rathod Tag: Parental Filter Tag: 81137
Time of inactivity
I have a vb.net application that starts with a login form.
I would like to show it again after 5 minutes of inactivity of the
application.
Now, I use a timer and I start it in the application.idle event, but it
doesn't work fine, because it shows the login form every 5 minutes of
activity or inactivity of the application, without differences...
How can I solve it ????
Many thanks
nq Tag: Parental Filter Tag: 81136
DataGridView tab order
Hello, I have a DataGridView with several columns. I would like to change
the tab order for the columns but I can not find a way to do this. There is
no property to set the tab order. I could listen for the tab-keypress but I
can not find a method setting focus on a specific cell in the DataGridView.
What I really would like to do is to skip a column when using Tab to
navigate the grid. Is this possible at all?
Cheers,
Chris Tag: Parental Filter Tag: 81135
Showing verbs in a PropertyGrid at runtime
I wished to show verbs in a PropertyGrid that is hosted in my own WinForms
application. The normal way to show verbs is to provide a IDesigner
implementation, however this only works when the PropertyGrid is hosted
inside of MSDEV. This is my solution, comments please.
using System;
using System.ComponentModel;
using System.ComponentModel.Design;
namespace Main
{
/// <summary>
/// The class enables an object, to display 'verbs' in the property grid.
/// It should NOT be used for any object that will be edited with the
/// property grid that is in MSDEV. It is only usefull for property grids
that
/// are hosted in a customer WinForms app.
///
/// Override the Verbs::get method in sub classes to return the set of
verbs
/// for that class.
/// </summary>
[Serializable]
public class VerbHelper : IComponent, ISite, IMenuCommandService
{
public VerbHelper()
{
}
#region IComponent Members
public event System.EventHandler Disposed;
[Browsable(false)]
public ISite Site
{
get
{
return this;
}
set
{
throw new Exception("I hope this is never called!");
}
}
#endregion
#region ISite Members
[Browsable(false)]
public IComponent Component
{
get
{
return this;
}
}
[NonSerialized]
Container mContainer = null;
[Browsable(false)]
public IContainer Container
{
get
{
if (mContainer == null)
mContainer = new Container();
return mContainer;
}
}
[Browsable(false)]
public bool DesignMode
{
get
{
return false;
}
}
[Browsable(false)]
string ISite.Name
{
get
{
return "My Name";
}
set
{
}
}
#endregion
#region IServiceProvider Members
public object GetService(Type serviceType)
{
if (serviceType == typeof(IMenuCommandService))
return this;
return null;
}
#endregion
#region IDisposable Members
public void Dispose()
{
if (Disposed != null)
Disposed(this, EventArgs.Empty);
}
#endregion
#region IMenuCommandService Members
public void AddCommand(MenuCommand command)
{
}
public void RemoveVerb(DesignerVerb verb)
{
}
public void RemoveCommand(MenuCommand command)
{
}
public MenuCommand FindCommand(CommandID commandID)
{
return null;
}
public bool GlobalInvoke(CommandID commandID)
{
return false;
}
public void ShowContextMenu(CommandID menuID, int x, int y)
{
}
public void AddVerb(DesignerVerb verb)
{
}
[Browsable(false)]
virtual public DesignerVerbCollection Verbs
{
get
{
//override this in a sub class to return your verbs.
return new DesignerVerbCollection();
}
}
#endregion
}
} Tag: Parental Filter Tag: 81133
Can't import .OCX assembly into Web Matrix Project.
Hi,
I am using Web Matrix Project as .NET programming environment. Can you show
me detailed steps how to import the .ocx library into the Web Matrix
Project. I can't seem to be able to import other assembly than .dll, .exe or
.mcl . I am pretty new to the .NET programming environment, and may be
missing something.
I can see the file in C:\Program Files\Common Files\Tops\xyzxyz.ocx , but I
can't find a way to import it into the Web Matrix Project to see all Methods
and Properties of the assembly.
Thank you for any help. Tag: Parental Filter Tag: 81130
create object dynamically
hi guys,
i just have a doubt about this one... i have several class that just
basically do CRUD operations (create, read, update, delete) now for example
on my delete function, i want to create objects dynamically based on
TableName..
this is my current line of code
Public Sub ActionButton_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Select Case TableName.ToLower
Case "employee"
Dim o As New BusinessLogic.EmployeeController
o.Delete(1)
Case "gender"
Dim o As New BusinessLogic.GenderController
o.Delete(1)
Case "more of this on my code"
Dim o As New BusinessLogic.[other]Controller
o.Delete(1)
End Select
End Sub
now i want to make this line of code shorter, maybe by doing this
Public Sub ActionButton_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Dim o As New BusinessLogic.[TableName]Controller
o.Delete(1)
End Select
End Sub
note the [TableName] here is a property i created, so passing a EMPLOYEE as
the TableName will
Dim o As New BusinessLogic.EmployeeController and then i can call the delete
function, just want to load object dynamically here.. i hope i made my point
here clear...
is it anyway possible?
TIA!
(if i have 8 hours to chop down a tree, i'd spend 6 sharpening my ax) Tag: Parental Filter Tag: 81127
Mouse event handlers
I am writing a 3D graphics demo for my students, and thought I had a really
slick solution for handling the interaction with the mouse. There are
several ways to interact with a 3D world, and I have attached a mouseDown
event handler to my OpenGL panel (control). What I want to do, is based upon
which mouse button was pressed associate the proper mouseMove event handler
with the control. OK, so I have a From with several controls, including a
few OpenGL controls I created. I attached the mousedown to an OpenGL
control. In the callback I want to associate the MouseMove and MouseUp event
handlers. I first tried something like this in the MouseDown event handler:
m_MouseMoveDelegate = new MouseEventHandler( camera.Trackball );
this.MouseMove += m_MouseMoveDelegate;
m_MouseUpDelegate = new MouseEventHandler( My_MouseUp );
this.MouseUp += m_MouseUpDelegate;
This associates the mouse handlers with the entire Form though, not the
control. I am rather clueless on the sender semantics. I tried casting it to
my UserControl (OpenGLPanel), but that led to very bad behavior. Not sure
why. I also need to retained the mouse position of the mouse down event.
The problem above is either the "this" identifiers, or trying to save the
mouse position from the mouse down event. Casting this to screen space
provides somewhat better behavior, but not ideal.
Questions:
1) Is there something fundamentally wrong with this design?
2) Is the sender one of the controls I registered the MouseDown event
handler to?
3) In particular, is it the control in which I pressed the mouse?
4) Can I associate a MouseMove event to the sender? Note, I do not want to
embed my form logic in here and test for which control, etc.
FYI. The mouseUp event simply removes the event handlers:
// Disconnect the MouseEventHandler
this.MouseMove -= m_MouseMoveDelegate;
this.MouseUp -= m_MouseUpDelegate; Tag: Parental Filter Tag: 81122
Getting the keyboard state in MouseMove
In my windows app, I have an event handler for the mouse move, and want to
allow for constrained interaction using the shift or control keys. I can not
figure out how to get the state of the shift, control or alt key modifiers
for the mouse. The mouseEventArgs does not seems to have anything, and
casting the sender to a control and trying to inquire has led to compiler
errors. This functionality exists in the Drag and Drop event args, but not
the mouse. How do we determine the key modifiers for the mouse in .NET?
Roger Tag: Parental Filter Tag: 81120
Trip to Disney
GET YOUR TRIP
TRIPS TO DESNEY
TRIPS TO HAWAII
http://travelexpert2004.us
http://travelexpert2004.biz
http://gotraveling85.us Tag: Parental Filter Tag: 81119
paper size and font for roll paper
Hi
I designing a report with Crystal (C#, winforms), my problems is how to set
the paper size for the width of the roll 3 inches and tall continuous large.
2.- There is only 40 char columns and monospace font, how to I set the
designer area for that purpose.
TIA Tag: Parental Filter Tag: 81118
I am looking to create our own Adult Filter using VB.Net. Any
suggestions???