Using a .dll to display a form
I have developed a .dll to display a form that controls a simple routine.
Oddly, you can't use
messagebox.show
unless you do one of two things:
either use an imports system.windows.forms
or
system.windows.forms.messagebox.show etc
Now this is strange, because the form inherits as below:
Inherits System.Windows.Forms.Form
Why is this and what other problems may I expect to encounter?
Thanks for any advice.
Bernie Yaeger Tag: ShowDialog an MDI Child? Tag: 64187
Help! Microsoft.Win32.SystemEvents.WindowThreadProc eating CPU
I have a windows forms application that occasionally eats
100% of the hosts system's CPU indefintely. If I break
execution and selectively freeze threads, the culprit
seems to be the thread named ".NET System Events".
That thread is in a tight loop within
SystemEvents.WindowThreadProc. I don't understand the
disassembly, but it appears to be stuck completely within
that method as I step through it.
As I understand it, that thread is responsible for
calling events when system properties change. I have
hooked none of these events in my code, and like I said
the thread appears to be looping entirely within the
WindowThreadProc method.
This happens most often when coming back from a Fast User
Switch in XP or resuming from a suspended/hibernated
state.
What is going on?? How can I work around this? It's
noticed by customers and makes us look bad.
-Brian Tag: ShowDialog an MDI Child? Tag: 64185
Bug in Windows Form Designer generated code (VS.NET 2003)
Every time I make a change affecting a toolbar (e.g. adding or removing
buttons), I loose the bitmap images at runtime. They are still displayed in
the designer, but when the application runs, the toolbar appears blank with
only separators visible. I determined that the problem is caused by the
wrong location of the toolbar.Buttons.AddRange function in the
auto-generated InitializeComponent function, which is placed before buttons
are initialized. If I manually move the AddRange function call after the
button initialization calls, it works fine, but the next time I make a
change, I have to do it again. This is really irritating. Is this a known
bug? Is there a fix for it? A better workaround? Thanks.
Alek Tag: ShowDialog an MDI Child? Tag: 64175
How to test a dialog
Hi,
Cannot find the dialog preview button in the form design mode (VS.NET 2003,
C#). I mean the option similar to MFC's (VC++ 6.0), which lets you quickly
open the dialog you are currently designing, so you can see what it looks
like without the grid lines and using default properties. Is it available?
Am I missing something obvious?
Thanks,
Alek Tag: ShowDialog an MDI Child? Tag: 64174
.NET Grid w/source & doc for only $49.99!!
Get GridQuick .NET control written entirely in Visual
Basic .NET 2003. A powerful grid that allows you to edit
cell contents and use different editors. You get the
source code, documentation and binary DLL file.
Have a look @
http://www.trycomed.com Tag: ShowDialog an MDI Child? Tag: 64168
Possibility to route different kind of events to only one handler?
Hello,
Does anybody know the possibility of routing different kind of events (Which
has different EventArgs like Click and OnPaint for example) to only one
handler sub?
I'm creating a designer control to allow the end users to design a form.The
user can drag new controls into this design surface and after the design I
move those controls to a normal windows form..At this point, I want to get
notified any of the events that those new controls will generate..And I
don't have predefind event subs already in my code which I can link those
controls...
Is there any possibility for this?
Thanks in Advance...
Özden Tag: ShowDialog an MDI Child? Tag: 64161
Client Operating Systems for .NET 2003
Hi, I am using window server 2003 to learn .NET 2003.
The .NET API is installed with the window server 2003.
* I guess .NET API is installed with XP.
* How about window 2000, 98, 95.
* How about Linux.
Please advice.Thanks.
Peter Tag: ShowDialog an MDI Child? Tag: 64160
smtp.attachment lockes file when send exception.
Hi there,
Im having a bit of trouble with a logfile I use to put events in with a
streamwriter, after I have written in this file I want to send the file as a
mail with an attachment with smtp.
This all works fine until the smtp server goes off line or something goes
wrong.
I'm then catching the exception and try again later.
Now there is the problem. The log file I tried to send is now locked so the
streamwriter throws me an exception.
Why is it locked, or better, how do I get it unlocked?
Anyone?
Try
SmtpMail.SmtpServer = SmtpServer
SmtpMail.Send(MyMail)
Catch ex As Exception
' Now the file is
locked
Return ex.Message
End Try Tag: ShowDialog an MDI Child? Tag: 64159
Application Losing Focus when running from exe
Hi,
I have a winforms app which, when run from the VS.NET
IDE, puts input focus on the startform as one would
expect.
However, when I run the exe directly, the main window
does not retain focus and I have to manually click on the
window to give focus to it.
Any explanations would be greatly appreciated.
Thanks Tag: ShowDialog an MDI Child? Tag: 64158
RE: add item to listbox
Ok, here's the deal. I tried to do this and it didn't work:
[Child Form "Form2"]
Event OK (ByVal item as Object)
'I cast it as Object simply because that's the type of a Listbox Item.
Private Sub Button1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Raiseevent OK(Lisbox1.selecteditem)
End Sub
--------------------------------
[Parent Form "Form1"]
Private Sub Form2_OK(ByVal item as Object) Handles Form2.OK
Listbox.Items.add(item)
End Sub
the fresh new item on Form1's Listbox shows "System.Data.DataRowView"
what's going on?!?!?!?!
thanx for all previous replies!
ignacio
----------------------------------------------------------------------------
------
>Hi Ignacio,
> I think it has something to do with not giving valuemember and
displaymember
> values (what values could I give? it's not bound)
You can bind a ListBox (via DataSource) to *any* object that implements the
IList interface. This includes Array or ArrayList. You just need to fill one
of these with suitable objects with a property for the string to display and
another for the data you need and set the DisplayMember and ValueMember
properties of the ListBox.
Cheers
Doug Forster
"Ignacio Martínez" <msnews@puturra.com> wrote in message
news:e3fiPPX0DHA.1708@TK2MSFTNGP12.phx.gbl...
> thanx for the 2nd response
> I had tried casting the [Object] Object from the child form to the parent
> form, but I only got "System.Listbox....something", instead of the text of
> the item I passed.
> I think it has something to do with not giving valuemember and
displaymember
> values (what values could I give? it's not bound)
>
> it's pretty damn hard!
> I wish I only had to show the text for the item, but I really need the ID
to
> continue using that item for other purposes on the parent form.
> anyway, thanx
> I posted this message on other MS groups but I got no reply so far.
> nice weekend!
>
> <anonymous@discussions.microsoft.com> escribió en el mensaje
> news:014b01c3d16e$4acbe4f0$a601280a@phx.gbl...
>
> >-----Original Message-----
> >ok, so basically I can't manually set the valuemember of
> a listbox item
> >(webcontrols are more flexible in this cases...)
> >
> >thanx!!!!!!!!
> >
> >"TB" <tbrown92030@kaxy.NOSPAM.com> escribió en el mensaje
> >news:01a401c3d168$ed142430$a401280a@phx.gbl...
> >
> >>-----Original Message-----
> >>Hey group!
> >>first of all, happy new year to everyone.
> >>
> >>I have a small problem that I haven't worked out yet and
> >it's driving me a
> >>little crazy.
> >>I have two forms with a listbox control on each one.
> >>
> >>the child form passes the selecteditem to the parent
> form.
> >>but I want to pass the whole item (Value Member, Display
> >Member) and I have
> >>no clue on how to do this.
> >>what I could do was to pass just the text as a parameter
> >in an event on the
> >>child form.
> >>but that doesn't suit my needs.
> >>
> >>I can't use databindings, because I need to do this
> >manually.
> >>is there a way to add the whole item????
> >>
> >>thanx in advance!
> >>ignacio martínez
> >>buenos aires, argentina.
> >>
> >
> >Ignacio,
> >
> >Usually when I need to get more data for a selected item
> >in a listbox I will set each item's "Tag" property to an
> >object that contains what I need -- usually an instance of
> >whatever object I am working with. Given a selected item,
> >you just cast it's Tag value to what you expect and you're
> >off!
> >
> >-- TB
>
> Lo siento, Ignacio,
>
> I'm afraid I didn't read your post carefully enough the
> first time around. ListBox controls are different from
> the ListView controls that I'm more used to. The latter
> accept "smarter" items (where each can have a tag). A
> listbox does not.
>
> Ok, so let me see if I am understanding your problem.
> When the user selects an item in your child form's listbox
> you want to pass along both the display member string
> *and* value member string for that selected object up to
> the parent form.
>
> The value data is, of course, the "SelectedValue" for the
> listbox. There is no corresponding "SelectedDisplay", but
> you can use "SelectedItem" to get the object you
> originally added to the listbox, cast it to the right type
> of thing, and then access the property directly. You can
> also get the value member this way.
>
> But you're right -- the ListItem Web object allows the
> text and value members to be specified but the normal
> Forms Listbox just takes untyped Objects for its items and
> applies the same DisplayMember and ValueMember properties
> to all.
>
> -- TB
>
> Tag: ShowDialog an MDI Child? Tag: 64157
How to (easily) change the width of a single column in a DataGrid [VB.NET]
I've run into a few posts on this, some with answers pointing to FAQs
(like http://www.syncfusion.com/faq/winforms/search/754.asp), but I
figured I'd go ahead and share the code I'm using. Basically, you
need to set up a for loop through every column in your dataset and
create a default action rigging up a DataGridColumnStyle for each.
Then look for the cols that need special treatment and knock yourself
out.
You might insert a "case else" below and move the mappingname and
headertext there to have a mutually exclusive default handler.
' Assumes you've got...
' Public dsTime As DataSet
' Public grdTime as DataGrid
Dim myGridTableStyle As DataGridTableStyle = New DataGridTableStyle
Dim TextCol As DataGridColumnStyle
Dim dcTemp As DataColumn
myGridTableStyle.MappingName = Me.dsTime.Tables(0).TableName
For Each dcTemp In Me.dsTime.Tables(0).Columns
TextCol = New DataGridTextBoxColumn
' I want my "description" column to be wider than the rest
' Select Case is overkill for one col, but is an easy place
' to expand to catch other columns
Select Case dcTemp.ColumnName
case "description"
TextCol.Width = 250
End Select
' Everything else gets added with defaults, though you
' need to provide a name for the column to show up in
' the DataGrid.
' Seems to keep the default validators and everything
' by simply doing the below
TextCol.MappingName = dcTemp.ColumnName
TextCol.HeaderText = dcTemp.ColumnName
myGridTableStyle.GridColumnStyles.Add(TextCol)
Next
' add formatted tablestyle to the datagrid
Me.grdTime.TableStyles.Add(myGridTableStyle)
' bind the datagrid
Me.grdTime.DataSource = Me.dsTime.Tables(0)
Ha, and if you search Google for something with "single" in it, like,
say, [datagrid "single column"], prepare for some Google Ads to
eHarmony.com & gotoCupid.com (though we all know GOTOs are Bad
Things), etc. Tag: ShowDialog an MDI Child? Tag: 64156
Control Focus issues
Hello,
A form with 3 textboxes and a button and the code
below :
Private Sub TextBox2_Enter
fred()
end sub
Private Sub fred()
TextBox3.focus
End
Private Sub TextBox3_enter
console.writeline("Entering")
End
Private Sub TextBox3_Leave
console.writeline("Leaving")
end
Private Sub Button1_Click
TextBox2.focus
End
The intent here is to start with the focus in TextBox1
(no events), click the button. The button changes focus
to TextBox2. The Enter event calls a routine that also
shifts focus, this time to TextBox3.
I would expect the output to be:
Entering
Instead I am getting
Entering
Leaving
Entering
This seems wrong and is causing some issues. In
practice, tabbing to 'TextBox2' takes the place of the
button click, but the end result is the same, a Leave
event at the "wrong" time.
mklapp Tag: ShowDialog an MDI Child? Tag: 64154
Combo box in DataGrid
The MSDN tells it would be possible to create own
DataGridColumnStyles and
there also exists a DataGrisComboBox in
Microsoft.ClrAdmin. It can be bound
to the GridColumnStyles Collection but just shows a
DataGridTextBox. Who already tried this successfully? Tag: ShowDialog an MDI Child? Tag: 64153
How do you debug a Designer Error from Inherited forms
I am getting an error in the Designer when trying inherit
a form.
Value cannot be null: Parameter Name dataSource
now I do not use the Name dataSource in any of the
inherited code so I am assuming that this is in the VS
Designer code somewhere.
The original base form comes up in the designer just fine.
If I Ignore the designer and compile the new Inherited
form it compiles and runs just fine.
Is there a way of debugging what the designer is doing
when it attempts to load the inherited form so I can see
what is giving the designer grief. Tag: ShowDialog an MDI Child? Tag: 64152
combobox FindString
Hello, help me please with combobox FindString,
I want to perform a search for an second substring entry in the combobox
items collection. I use the FindString with specifying a starting index
within the ComboBox. I have tried the following but none seem to work:
cmbBox.FindString(strWhat, cmbBox.FindString(strWhat)) - :( don't work
For example:
if Items count is 1 - I have only one item in the items collection,
cmbBox.FindString(strWhat) return 0 - this only one item starts with strWhat
With FindString(strWhat, 0) i receive ArgumentOutOfRangeException error...
Why, if error condition is: "The startIndex is greater than the last index
in the collection."????
How I can do this? Tag: ShowDialog an MDI Child? Tag: 64151
The operation could not be completed
Hi
All was fine and suddenly from the moment
if I click on my Crystal Report file in
solution explore the message
The operation could not be completed
is displayed.
Can somebody help me what is it?
Thanks
Konrad Tag: ShowDialog an MDI Child? Tag: 64149
Propertygrid context menu
Hi
In the VS .Net the Propertygrid has a context menu
with 'Reset' and 'Description' menu points.
I want to have this context menu also for runtime
PropertyGrids.
How can this be done?
Sincerely
orbit Tag: ShowDialog an MDI Child? Tag: 64144
Saving Rich Text to Database
How do i save text in a RichTextBox Control to a SQL
server Database and retrive it back without losing its
formatting. Tag: ShowDialog an MDI Child? Tag: 64142
WinForms UserControl problem at VS.NET design view
Hi,
I'm working on a Win form application which is being developed in VB.Net. I
have created few User Controls quite some time back and implemented them
successfully. Now the problem is, I'm not able to use UserControls using my
VS.NET IDE. When I tried to drag and place the user controls on WinForm
(from Toolbox), it shows an error saying "An exception occurred while trying
to create an instance of Classname.UserControlName. The exception was
'Value cannot be null. Parameter name:path'". And another strange problem
is when I tried to open my existing solution, the controls are missing and
an error is shown like "The Variable 'UserControlName' is either undeclared
or was never assigned.
Could some one please help on this ASAP? Your help is muchhhly appriciated
as we are closed to the deadline.
Thanks in advance,
Kiran Tag: ShowDialog an MDI Child? Tag: 64140
about email questions
in windows form, I can use the System.Web.Mail
how can I send the email to the client??
any reference site? Tag: ShowDialog an MDI Child? Tag: 64139
SQLDataAdapter SP Generation
Hi,
I have created an SQLDataAdapter component on my vb.net winform project and
stepped through the wizard. In my SQL Database I have a table with fields
using user defined data types and not the base data types. The problem is
that when the stored procedure gets created by the adapter the parameter's
data types did not follow the data type of the table I used in the wizard.
Is there any solution on how I could use my user defined data types in my
SP, autogenerated by the adapter, w/o actually modifying the SP after
running the wizard?
Appreciate any help.
Thanks.
Ramil Domingo
Developer Tag: ShowDialog an MDI Child? Tag: 64136
Web browser in winforms
Hi,
I need to embedd web browser control in of my winform
where there is a collection of forms.
My problem now is the form embedded is a child form.
When I am trying invoke this in a normal form it is
working fine. But when invoking from a child window it is
not work.
Any solution for this?
Thanks and Regards,
Sachi Tag: ShowDialog an MDI Child? Tag: 64135
Suggestion for implementing controls based on rules
Hi everyone;
We have a problem in our compact framework client-server application
for which we would require your valuable suggestions.
Problem:
There are controls in the application user interface that has to be
loaded based on rules / transaction codes else they are not displayed
at all, hence the controls won't be there at design time but they
would have to be created and placed at run time.Hence a elegant and
simple solution has to be designed to meet out the requirements.
Solution:
We are leaning towards getting all valid transaction codes from the
database and loading into memory at the start of the application. When
a form is created for the first time,the form and all the form
controls are created based on the transaction codes.The form is then
saved into a form factory. If that form is required again then it is
loaded from the form factory.
I would appreciate some comments or suggestions to this approach.
Thanks and Kind Regards;
Ajit Goel Tag: ShowDialog an MDI Child? Tag: 64134
Deploy ODBC connection
Hi,
Using VB.NET how can I deploy ODBC connection to automatically install when
the package is installed?
Yama Tag: ShowDialog an MDI Child? Tag: 64133
Textbox formating
I have a textbox on a form that I want to display the
entered data as a date, without the user having to use a
date seperator. I've tried user-defined date formats and
user-defined number formats(to insert the seperator). But
the text always changes to the style string instead of
converting to the style string as follows:
TextBox1.Text = Format(Textbox1.Text, "MM,dd,yyyy") Tag: ShowDialog an MDI Child? Tag: 64129
form control validation error and focus
Hi, I have a problem as below:
* The form control is TextBox.
* Method: textBox1_Validating(...)
* When a validation error occurs, the focus stays.
* If I can not find the valid data, and I want to cancel.
* I do not know how. Please advise. Thanks.
Peter Tag: ShowDialog an MDI Child? Tag: 64128
Load event firing twice for one form instance
I have a form which I want to show modally; it's a fairly old form
that's been ported up several versions of VB, and I'd like to keep its
rewriting to a minimum. Basically, it is used in this sequence:
1. The form is shown. The Form_Load event does some initialization.
2. Further parameters are passed to this form.
3. We actually need this form to be modal, so we hide it and show it
again modally.
4. Stuff happens on the form based on the parameters passed in, etc.
(The VB.NET code for this is below.) However, I've discovered that
calling ShowDialog() in step #3 fires off the Form_Load event a second
time, even though it's the same object instance. Does any instance of
showing a form fire this event?
(My problem here is that the Form_Load initialization should only
happen once. I could use an already_initialized flag, but that's
horribly messy; if I have to, I'd rather pass Foo in the constructor
and hold onto it through the Form_Load process.)
--Caitlin Shaw
**Code**
Private WithEvents frmThing As ThingForm
Public Sub DoThatThingWithFoo(Foo as Object)
'Create the thing and set it up
frmThing = New ThingForm()
frmThing.Show()
frmThing.DoSomeSetup(Foo)
'Really, though, we want this thing to be modal
frmThing.Hide()
frmThing.ShowDialog()
'Good, that's done
frmThing.Dispose()
End Sub Tag: ShowDialog an MDI Child? Tag: 64125
MouseLeave does not work !
Hi,
I designed a usercontrol and I assigned a handler to the MouseLeave
event !
It fires 80% of the time but when you manage to move your mouse very
fast out of the control it does not !
Does someone know a workaround ?
Arkam Tag: ShowDialog an MDI Child? Tag: 64120
NotifyIcon is greyscale under Windows 2000
Doing developing under Windows XP,VS.NET 2003,.NET 1.1 Framework.
Assign notifyIcon an icon *.ico file. Appears fine (color) in task tray when
running under windows XP.
When I run on Win 2000 test machine with .NET 1.1 Framework installed, the
app runs fine but the task tray icon is greyscale, rather than color.
Thinking it was some glitch with this particular icon, I've tried dozens of
different icons (from inside shell32.dll) with the same results. Anybody
have any idea what this is? Tag: ShowDialog an MDI Child? Tag: 64117
Yet another No Touch Deployment Issue
Hi,
I am writing an application that has to be run via a web browser and it also
must run using the default security settings for an internet application
(Framework 1.1). Which is the lowest setting.
Part of the Design Specs is that each user's preferences are saved. I
thought about using Isolated Storage for this and saving the User's Settings
to a xml config file, but I can't save to Isolated Storage with the Default
Security Settings. Does anyone have any other suggestions I can try? I
know I can store the info on the web server as well and access via a
WebService, but I was hoping for a way to accomplish this without storing
the information on the Server.
TIA,
--
Paul Tag: ShowDialog an MDI Child? Tag: 64116
Problem with OCX component: property OcxState not setuped
Hi I have a Ocx developed in V.B. 6 and I'm trying tu use
it in C# application but during the InitializeComponent()
method I get an Exception:
'System.Resources.MissingManifestResourceException' en
mscorlib.dll
Aditional information: Could not find any resources
appropriate for the specified culture (or the neutral
culture) in the given assembly. Make
sure "frmKernel.resources" was correctly embedded or
linked into assembly "Kernel".
This is the code that it try to execute:
this.axMonitorSend1.OcxState =
((System.Windows.Forms.AxHost.State)(resources.GetObject
("axMonitorSend1.OcxState")));
Please help me
Regards Tag: ShowDialog an MDI Child? Tag: 64115
adding items to forms' resource files
Please let me know if there is a better way to do this.
I have set the Localizable property of my forms to true,
meaning of course that it will persist the properties of
the controls of my forms in the resource file for that
form. But my question is, how do I add additional
properties for that form to the resource file? For
instance, I have error messages, tooltips, log messages,
etc., associated with each form. It makes sense to me to
be able to add those to the form's resource file and then
to be able to reference them from within code (using the
resource variable that VS generates). However when I add
them, after I make changes to the form in Visual Studio,
the items I added are gone.
I am aware that I can create a new resource file and
reference from there but I'd like to avoid that since
there is already a resource file for each form created.
Thanks for any tips,
Andrew Tag: ShowDialog an MDI Child? Tag: 64113
Standard and other toolbar icons/bitmaps
I'm being dead thick, but I can't get my head around
this:
Where can I get standard toolbar icons like Open, Save,
Print etc from? Should I embed them in my app or can I
assume that any system will have them? How does each
version of WIndows differ - do I need to know what
version the user is running and pick icons accordingly?
I've pulled a bunch of other icons from dlls, and want to
use some. However they have white backgrounds both in the
Image Editor and when displayed. The host ImageList
TransparentColor property doesn't make a difference.
Changing the bitmap background from Opaque to Transparent
doesn't make a difference.
There's nothing in any of the .NET books I have, and I
can't find anything online. What am I missing? Tag: ShowDialog an MDI Child? Tag: 64108
Use an Ocx
Hi
I have an ocx developed in VB 6.0 and I nedd to use it in
Window Form application in C#. When I do it, I get a
System.NullReferenceException
I've added the reference and in my application I wrote:
//Global Variables
Monitorsdn.MonitorSendClass sendMon = null;
short local = 0, remoto = 0;
string socket = "C", sPath = "C:\mon.ini"
public myForm() {
InitializeComponent();
InitializeOcx();
}
private void InicializeOcx() {
short shEvent = 1;
sendMon.Monitor(ref shEvent, ref local, ref remoto, ref
socket, ref sPath);
}
Do I need do or include something else??
What's wrong???
J.C. Tag: ShowDialog an MDI Child? Tag: 64107
How to do SMS in window application?
Hi,
I am currently working on mobile application, and I am try to implement SMS
(text message) into my window desktop application. Add codes to VB app and
sent
SMS to Smartphone device as a notification message.
What api or dll do I have to use in VB app.?
I know that there is a SMS lib in mobile platform, but not in window appl.
Please help. thank you Tag: ShowDialog an MDI Child? Tag: 64103
ReadOnly DataGrid
Hi,
I want to create a readonly grid.
By this I mean that none of the cells should be editable.
At the moment I have set the readonly property of the grid
to true.
This is OK for 'DataGridBoolColumn' i.e. columns
displaying checkboxes, but for DataGridTextBoxColumn, the
background is greyed out, and a cursor starts blinking in
the cell.
I don't want this cursor to appear at all, and the whole
grid line shuld appear as if the user had clicked the row
header.
I thought there would be an easy way of doing this?
Cheers
Fred. Tag: ShowDialog an MDI Child? Tag: 64094
Calling Dispose on form variables.
Hello All,
I've a doubt regarding calling Dispose() method on the
controls of a form.
I've a simple MDI form. On a click of a menuItem I
instantiate a new modeless form. As per a prior message
posted
(http://blogs.gotdotnet.com/rprabhu/permalink.aspx/af94ee11
-5488-4ff0-bd5b-d7b41a0d0ebf), modeless forms are disposed
whenever they are closed. This is also happening in my
case as the dispose method is being called. So far so good.
But I noticed that the code to call Dispose() for all the
controls in this modeless form is not generated by VS.
Only some of the controls(e.g. System.Windows.Forms.Timer)
which are being added to 'IContainer components' member
variable of the forms are being Disposed. Rest for all
other controls, I've to call the Dispose method manually.
I've no problems in doing this, but I wanted to know why
this is done?
The controls in this modeless form are custom control and
all implement a common application specific interface.
When I try to call their Dispose methods, some of the
controls throw this exception
Exception : "InvalidOperationExcepiton"
Message : Cannot call Invoke or InvokeAsync on a control
until the window handle has been created.
StacKTrace : at
System.Windows.Forms.Control.MarshaledInvoke(Control
caller, Delegate method, Object[] args, Boolean
synchronous)
at System.Windows.Forms.Control.BeginInvoke(Delegate
method, Object[] args)
at System.Windows.Forms.Control.BeginInvoke(Delegate
method)
at System.Windows.Forms.DataGrid.OnLeave(EventArgs e)
at System.Windows.Forms.Control.NotifyLeave()
at
System.Windows.Forms.ContainerControl.UpdateFocusedControl
()
I'm not able to make it out, what this exception is, and
how can I handle.
Can anyone help me out in both of my doubts?
Thanx in Advance.
Mahesh. Tag: ShowDialog an MDI Child? Tag: 64093
Suggestion: a default ListViewItemComparer in System.Windows.Forms
Would be nice to have a default ListViewItemComparer ;-)
come on framework guys ;-)
probably an oversight but lets fix it and get a simple default comparer into
v1.2?
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemwindowsformslistviewclasscolumnclicktopic.asp?frame=true
--
Eric Newton
C#/ASP Application Developer
http://ensoft-software.com/
eric@cc.ensoft-software.com [remove the first "CC."] Tag: ShowDialog an MDI Child? Tag: 64090
New cool software
Hi guys,
Check out this software I found on the net...
http://www.dualdot.net/default.asp?nav=imagebatch
It's called ImageBatch and has a batch mode for converting, naming and
resizing images...
It's very cool! Tag: ShowDialog an MDI Child? Tag: 64087
Instance Forms
I'm starting with vb.net, and i already come across with
some problens.
i have three forms.
The start form is form1.vb, and it have two buttons.
Button1 shows Form2.vb, and button2 shows Form3.vb.
I've place the instance of the two forms into the main
body of the form (i.e. outside any Subs, Events or
Methods):
Dim F2 as new Form2
Dim F3 as new Form3
If i do this and try to run the project the main form
doesn't appear.
If i only instance a form, the main form appear when i
run the project.
Theres any one who can help me.
Thank you all.
Ana Rita Tag: ShowDialog an MDI Child? Tag: 64078
Populating Dataset from xml fil
I have an XML file which has elements with nodes. I can
load this XML file into a .NET xml document and then
populate a dataset with it.
Since this xml file has nesting (only 1 level, like master-
detail relationship) so can I populate 1 datatable with
the parent elements and another datatable with the child
nodes.
Please provide some information on this. Any pointers or
code will be appreciated.
Thanks
neel Tag: ShowDialog an MDI Child? Tag: 64077
Event bubbling in windows forms?
Hi
If an event (such as a click on a button) is not handled
by that button class, is it not passed to the containing
window, (say the form) so it can be handled there?
I basically have a form with 30 small buttons on and wish
to have one generic handler for the button clicks.
Thanks
John. Tag: ShowDialog an MDI Child? Tag: 64073
Create new event handler or override existing handler?
While developing on windows forms, I found that most forms events (e.g. Load, KeyPress, MouseMove, LostFocus, etc....) have the equivalent virtual functions in the form of OnXXXX which can be overwritten. If I want to handle the KeyPress event, is it recommended to create an event handler in the constructor,
this.KeyPress += new KeyPressEventHandler(form1_KeyPress);
or to override the OnKeyPress virtual function?
I have tested both ways and didn't find any substantial differences between them. Is there any guideline to follow on which method to use? Tag: ShowDialog an MDI Child? Tag: 64070
Dynamic Menu Query
Hi ,
My requirement is to create menu dynamically based on
user permissions.
So I had decided to have the details about menu in a xml
form. Now I had also go few article which does something
similar to this.
In this below article menu is been built from a database
table.
http://www.codeproject.com/cs/menu/csdynmenudemo.asp
Any one got this kind of component? Any clues?
Thanks and Regards,
Sachi Tag: ShowDialog an MDI Child? Tag: 64068
Drawing on the desktop
I'm writing a docking window control, and need to write on the
desktop, so I can show a candidate dock rectangle on top of the dock
manager's child controls.
I found
[DllImport("user32.dll")]
private static extern IntPtr GetDesktopWindow();
and
[DllImport("user32.dll")]
private static extern IntPtr GetShellWindow();
but when I do
IntPtr Handle = DesktopWindow();
Graphics Desktop = Graphics.FromHdc(Handle);
Desktop.ReleaseHdc(Handle);
private IntPtr DesktopWindow()
{
IntPtr Result = GetShellWindow();
if (Result != IntPtr.Zero)
return Result;
return GetDesktopWindow();
}
in an OnPaint or OnMouseMove handler, I get an "Out of memory"
exception - even when I don't draw anything!
Google shows me that others have this problem - but doesn't show me a
solution ....
--
programmer, author http://www.midnightbeach.com
and father http://www.midnightbeach.com/hs Tag: ShowDialog an MDI Child? Tag: 64066
UserControl
Hello,
I have a component derived from System.Windows.Forms.UserControl and I
want it to show vertical scroll bar all the time. I tried to set:
this.VScroll = true;
but it didn't have any effect.
Any help would be appreciated.
Thank you. Tag: ShowDialog an MDI Child? Tag: 64065
No Touch Deployment and Win 2003 Server?
We're testing our Winforms app on Windows 2003 server. For
previous servers we had to remove the .config file mapping
so the machine config could be downloaded by the
application. In Win 2K3 Server no file can be downloaded
unless there is a mapping for it, which creates a problem.
Anyone know how to configure Win2k3 Server to work with a
no touch deployment and get the machine config file
downloaded?
Thanks in advance.
--
Dave Tag: ShowDialog an MDI Child? Tag: 64064
Why it is not painting classes that are directly inheriting from Control class.
I want to make custom control. The problem is, i want to inherit from
System.Windows.Forms.Control class not System.Windows.Forms.CustomControl.
Although i have overriden the method OnPaint in my class and draw something
inside it, it doesnt draw in the main form that i add my custom control.
public class MyCustomControl : System.Windows.Forms.Control
{
protected override void OnPaint (PaintEventArgs e)
{
base.OnPaint (e);
e.Graphics.DrawRectangle (new
System.Drawing.Pen(System.Drawing.Color.Red,2),0,0,this.Width,this.Height);
}
}
It doesnt enter the OnPaint method. But if i change the base class to
UserControl, it draws my custom control. Can anyone explain this to me,
please.. Tag: ShowDialog an MDI Child? Tag: 64059
Hi,
I would like to know how I could do the above subject without getting any
errors?
* "Ramil Domingo" <ramil_d@togethersoftware.net> scripsit:
> I would like to know how I could do the above subject without getting any
> errors?
>
> Any help is very much appreciated.
Show the form as a normal form, not an MDI child. I never saw what you
want to do in an application.