ActiveX Error with multiple AxWebBrowser controls within a tab-control
I have a tab control in a which a few of the tabs include an AxWebBrowser
browser control (More accurately, I'm using Carl Nolan's Html Editor in all
but one of the tabs). When closing the application, a few .net error
messages flash on the screen, too quickly for me to see the error message (I
assume because the application closes immediately after. This does *not*
happen if every webbrowser control is actually drawn to the screen at some
point in the applications lifetime (so as long as each tab is selected at
some point, these error messages do not occur). A similar problem occurs
when I am editing the same form in Visual Studio. If I close the form
without selecting each tab, I receive an error message saying: "The
following exception has occured: TargetInvocationException: Unable to get
the window handle for 'AxWebBrowser' control. Windowless ActiveX controls
are not supported". This message pops up multiple times, always
corresponding to the number of tabs I have *not* selected. I've found a
very small number of posting of people who have had a similar problem, but I
can't find any kind of resolution. Does anyone have any ideas as to what
may be causing this error, and how to avoid it?
Thanks,
Joe Tag: Multiple Item DragDrop w/Listboxes Tag: 78001
Exception trying to instansiate an inherited form
I have created a form for my application. Once the form was working, I
copied that form to a new form that would contain all the common elements of
all forms in my application and made the existing form inherit from the
common one. Now when I try to run my application I get the following error
when I open the form:
An exception occurred while trying to create an instance of
WebWinFormTry1.frmNITSSForm. The exception was "Constructor on type
MyAppTest.frmParentForm not found.".
The relevant code for the 2 classes is included below. Can anyone tell me
what I am doing wrong here. As far as I can tell, I have the constructor
for both defined.
TIA
Ron L
frmParentForm.vb:
Option Strict On
Imports System
Imports System.Drawing
Imports System.Collections
Imports System.ComponentModel
Imports System.Windows.Forms
Imports System.Data.OleDb
Public Class frmParentForm
Inherits System.Windows.Forms.Form
Protected frmMain As myAppMain
Protected textIsDirty As Boolean
#Region " Windows Form Designer generated code "
'Public Sub New() ' Default constructor not implemented. Need to pass
the parent form in to work.
' MyBase.New()
' 'This call is required by the Windows Form Designer.
' InitializeComponent()
' 'Add any initialization after the InitializeComponent() call
'End Sub
Public Sub New(ByRef frmMainNew As myAppMain)
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
frmMain = frmMainNew
Call BindAndLoadControls()
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
... code removed for brevity
#End Region
... other common functions here
End Class
frmChildForm.vb:
Option Strict On
Imports System
Imports System.Drawing
Imports System.Collections
Imports System.ComponentModel
Imports System.Windows.Forms
Imports System.Data.OleDb
Public Class frmUserAdmin
Inherits MyAppTest.frmParentForm
Private dsUserList As New DataSet
Private dsUserData As New DataSet
Private dsPermissions As New DataSet
Private permsList As DataTable
#Region " Windows Form Designer generated code "
'Public Sub New() 'Default constructor not implemented. Need to pass in
main form to work.
' MyBase.New()
' 'This call is required by the Windows Form Designer.
' InitializeComponent()
' 'Add any initialization after the InitializeComponent() call
'End Sub
Public Sub New(ByRef frmMainNew As NITSSMain)
MyBase.New(frmMainNew)
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
frmMain = frmMainNew
Call BindAndLoadControls()
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
... Code removed for brevity
#End Region
... code removed for brevity
End Class Tag: Multiple Item DragDrop w/Listboxes Tag: 77995
System Tray Program
Using VB.NET.
How can I create a system tray program that displays number as my system
tray icon instead of an actual icon?
I am creating a weather program and when I minimze my program to the system
tray I would like to show the temprature in the system tray.
thanks in advance,
Lou Tag: Multiple Item DragDrop w/Listboxes Tag: 77991
DataGrid Column Headers
I have a number of datagrids bound to collections. When the collections are
populated i get the column headings as per the ColumnStyles for the grid.
However if the collection is empty no column headings are visible.
Is there a way to force the headings to display other than having a dummy
item in the collection?
guy Tag: Multiple Item DragDrop w/Listboxes Tag: 77990
RichTextBox Fields
Hy,
Is there any way (other than implementing it all by myself) to have text
sections within a RichTextBox be only editable as whole sections? (namely,
the user won't be able to select parts of a section and would only be able to
delete the entire section)
Thanx Tag: Multiple Item DragDrop w/Listboxes Tag: 77989
RichTextBox Fields
Hy,
Is there any way (other than implementing it all by myself) to have text
sections within a RichTextBox be only editable as whole sections? (namely,
the user won't be able to select parts of a section and would only be able to
delete the entire section)
Thanx Tag: Multiple Item DragDrop w/Listboxes Tag: 77988
Group icon blank when multiple dialogs are open
In my application, if one dialog is open, the taskbar icon shows as the icon
of the form. If multiple dialogs are open, then windows groups them under
one icon in the task bar, but the icon is blank. The application definitely
has an icon, as is show by the compiled executable. Does anyone know why
it's blank? Tag: Multiple Item DragDrop w/Listboxes Tag: 77983
Database independent application using C# 2003
Dear all
I have to develop a database independent application in c# 2003. It means
the underlying database should be anything like ACCESS, Oracle or SQL and my
application should not get affected if i change between databases. i also
have a requirement of storing 10,000 user records in my database. This
database can also be created by our customers and weshould be able to use
it.
After reading ADO.NET i felt convinced that it is the solution for my
requirement. But later i was thinking when i want to create a database
independent application why i should use a database first of all, instead i
can use XML.
The following are the points supporting it.
1. XML universally accepted/standardized.
2. No hassle of connection to a database server, changing the DB adapters,
customers having different databases facing problems in entering the data
3. Easily transferable and portable. Anybody can edit an XML file as there
are lot of freeware available.
The following are the points opposing it
1. Performance of parser while supporting 10,000 user records
2. Is it wise to think XML can be used in this way?
Please help me out. Also from where can i get a sample c# applications
storing the large user data (10,000 records) in XML file
Ciao
Hari Tag: Multiple Item DragDrop w/Listboxes Tag: 77975
override of TreeView
hi
i want to override the windows forms tree view in a custom control in a way
so the selected tree node does not center itself inside the tree view (is
quite nasty if the tree view is scrollable, then you have to scroll back to
get to the little + in front of the name).
does anybody know which of the many focus methods i have to override for
this purpose and how?
regards gabriel Tag: Multiple Item DragDrop w/Listboxes Tag: 77974
How to read All Data from SerialPort (2005)
Hi,
I'm experimenting with the Serial Port in VB.NET 2005. Although it isn't
that easy to get any feedback from my COM-port as I thought it would be...
How can I read all the Data that the port sends back?
I tryed with SerialPort1.ReadLine, but that blocks the application and takes
a lot of time (10 seconds!), I tryed SerialPort1.Read, but I have to read it
into a buffer and has to indicate the count, but how do I know this?
Does anybody knows a nice way to send and receive smoothly all the data from
the SerialPort?
Thanks a lot in advance,
Pieter Tag: Multiple Item DragDrop w/Listboxes Tag: 77973
3-D FlatStyle is too flat!
Hi,
A System.Windows.Forms.Button with FlatStyle set to 3-D (Standard) is not
3-D enough for my application. Its hard to tell when the button is up or
down.
Users of my application need a strong visual feedback.
Does anyone know if its possible to increase a Button's border
width/thickness
without overriding the Paint event and drawing the button manually?
Thanks, Jeff Tag: Multiple Item DragDrop w/Listboxes Tag: 77971
MdiChild - calling OnLoad() and OnActivated()
i noticed the following behaviour in my MDI-Application:
The order on wich the methodes OnLoad() and OnActivated()
of a MDI-Child gets called first, depend on the value of
the property WindowState of the Mdi-Child.
If WindowState of a Mdi-Child has the value of "Normal",
OnLoad() gets called bevore first call of OnActivated().
If WindowState has the value "Maximized", OnActivated
gets called first time bevore OnLoad().
Can someone explain this benaviour?
thanks
Torsten Tag: Multiple Item DragDrop w/Listboxes Tag: 77967
Delete allowed even when datagrid is set to readonly!
I have a datagrid bound to a strongly typed dataset. The datagrid can be made
readonly by either setting its ReadOnly property to True or by setting the
dataset's DefaultView's AllowDelete, AllowEdit, and AllowNew properties to
False. But in either case the datagrid still accepts a delete keypress (i.e.
press the delete key on the keyboard) and while this doesn't actually delete
the record it does set the dataset's HasChanges property to True thereby
causing my code to incorrectly ask the user to save his changes. Can this
problem be fixed? Tag: Multiple Item DragDrop w/Listboxes Tag: 77965
Display XML held in a string
Hi,
I have a string with XML in it. I want to display this xml in a windows
form.
I have looked at Microsoft Web Browser control, but it seems to want to work
with a url. How can I just pass my xml string for displaying?
Thanks
Martin Tag: Multiple Item DragDrop w/Listboxes Tag: 77963
.NET Equivalent for ShowCaret, SetCaretPos
Is there a .NET equivalent to the Win32 API's for ShowCaret and
SetCaretPosition. I am trying to draw a blinking caret and hope that I donot
have to go through and create my own graphics routine just to get a native
caret look alike Tag: Multiple Item DragDrop w/Listboxes Tag: 77962
assign the socket permission to the NTD winform
hello
i write a smtp client winform (using socket 25 connect to smtp server),and
deploy it to iis by NTD (no-touch deployment),i can launch the form from the
client machine,when i want connect to the smtp server,the security exception
is thrown,i know that i have not assigned the socket permission in the
client side to the downloaded assembly,but i don't know how to do that,who
can give me a step-by-step instruction.
any help will be appreciated. Tag: Multiple Item DragDrop w/Listboxes Tag: 77956
BUG: WinForms Status Bar Problem on XP
I think I've discovered a bug in the WinForms StatusBar control as
implemented on Windows XP. A picture is worth a thousands words so:
This is the way my form is *supposed* to look. Here you can see it running
on my development server which is Win2003 Server:
http://temp.codefanatic.com/usenet/looksgood.jpg
This is the way my form looks on XP. Notice the status bar is being
overwritten with the group box control:
http://temp.codefanatic.com/usenet/looksbad.jpg
The .NET code is identical on both machines. Any ideas?
Sal Tag: Multiple Item DragDrop w/Listboxes Tag: 77946
Issue with messageBox
Hi
I just fould a issue with MessgeBox. When i show the messagebox in my
app. Now if the user click any where else on the form out of messagebox. The
click event is kind put in a que. Now if there is a button or other control
where that person clicked, the button / control click event is fired after
my earlier procedure has finished.
Here is how you can duplicate the thing.
- Create a windowsform, put a button control on it,
- Write a procedure onClick event of button
Private Sub button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles button1.Click
MessageBox.show("Test", "Test", MessageBoxButtons.OKCancel,
MessageBoxIcon.Question, MessageBoxDefaultButton.Button1,
MessageBoxOptions.DefaultDesktopOnly)
End Sub
- Now Build and run the app
- Click the button
- {move the Messagebox out of the way, so you can see the button}
- click on the button again
- now click any button on the Messagebox
- {Now here is the problem} you will see the message box again. {message box
for second click}
can some tell how disable this feature in my app. or work around.
i have tried disabling the control and also form before displaying the
messagebox but still the same problem.
Can anybody help
Thanks in advance
mk Tag: Multiple Item DragDrop w/Listboxes Tag: 77945
Control validation problem prevents me from tabbing out of a contr
I am using simple databinding on a small form with only about 10
controls. My problem is that the _second_ time I open the form and
edit a value, I am no longer able to tab or click out of the control
that I just changed the value in.
Here's what I mean:
1. Open the app
2. Open the Details form (form uses databound values for textboxes,
code below)
3. Edit the value in the ItemName textbox
4. Click the OK button to close the form
5. Open the Details form a second time
6. Edit the value in the ItemName textbox
Result --> I am now unable to tab out of the ItemName textbox, click
OK or do anything but close the form.
This appears to be a problem with validation, since I cannot click on any
buttons with CausesValidation = true but I can click on buttons with
CausesValidation = false. However, none of my controls on the form have an
event handler for the Validating event.
This happens consistently throughout my application, on both small
forms and large forms.
I must be doing something incorrectly. Can someone point it out to me?
Here's some code:
MyDataSet.MyRow row = // a valid row from a typed dataset
Inside Form_Load:
BindField(ItemName, "Text", row, "ItemName");
public static void BindField(Control control,
string propertyName,
object dataSource,
string dataMember)
{
Binding binding =
control.DataBindings[propertyName];
if (null != binding)
control.DataBindings.Remove(binding);
control.DataBindings.Add(
propertyName, dataSource, dataMember);
}
--
----
Doug Perkes Tag: Multiple Item DragDrop w/Listboxes Tag: 77943
How to change the font of the main menu in application window?
I am developing a windows forms application using VS.NET in C#. I am using
the MDI style. I have a main menu defined with several layers of menu items.
I know that I can change the appearance of all menus by changing the Menu
property within the advanced appearance of the system display properties.
But I only want to change the font size and style of the menu within my
application.
How can I change the font of the menu only for my application?
Thanks,
Dave Tag: Multiple Item DragDrop w/Listboxes Tag: 77940
Annoying! Form Cannot Be Activated Eventually (.NET 1.1)
This is so annoying that I have to see if it's happened to anyone else and
see if I'm missing something well-known (I am not a WinForms expert).
Frequently, my form loses the ability to become active. This happens when
I'm debugging with VS.NET 2003 - I've been debugging for a while, so
wouldn't know whether it happens outside of the debugger.
It happened just now when I maximized the form. It maximized just fine, but
changed appearance to look inactive, and in fact was inactive. Clicking on
any part of the form doesn't change anything. Mousing over a top-level menu
item highlights it, but clicking on it does nothing. Mousing over the Close,
Minimize and Maximize buttons highlights them as well, but clicking does
nothing.
Right-clicking the notification icon shows the correct menu, and I can
minimize, maximize and restore. None of those makes the form active.
Clicking in the body of the form seems to make the form caption flash
briefly, but nothing happens.
Now, the one thing I'm doing that's a bit unusual is that I'm hosting
several one of several user controls in a panel in the middle of the form. I
_did_ have a problem with these. I had meant to remove and Dispose the old
user control before adding the new one, but that didn't work:
public static void ShowControl(Control control, Control container)
{
System.Collections.ArrayList disposeList =
new System.Collections.ArrayList();
foreach (Control old in container.Controls)
{
disposeList.Add(old);
}
foreach (Control toDispose in disposeList)
{
container.Controls.Remove(toDispose);
if (!toDispose.IsDisposed)
{
//toDispose.Dispose(); // This crashed. I forget the exception.
}
}
control.Dock = DockStyle.Fill;
control.Size = container.Size;
container.Controls.Add(control);
control.Show();
control.BringToFront();
}
Maybe this is catching up with me.
Any suggestions? Every time this happens I have to start over. The only way
I can close the form is through "End Process" in Task Manager!
-----
John Saunders Tag: Multiple Item DragDrop w/Listboxes Tag: 77939
Draw table with GDI+
Is there a quick and easy way to draw a table on a winform? For my
university assignment, we are asked to practice drawing with GDI+, so we
are not allowed to use any built-in controls.
The table has 5 columns and 2 rows and the first row is the heading.
I guess I could use g.DrawRectangle() and g.DrawLine() repeatedly, but
that's too cumbersome, plus I want to achieve something like DrawRow(1)
to insert data to a cell.
Any good ideas?
Thanks
Walter Tag: Multiple Item DragDrop w/Listboxes Tag: 77938
Passing large data between forms
Hello,
I have an application that simulates heat exchangers.
There is a Edit form that allows to edit the parameters of the heat
exchanger - 50-60 parameters. Currently Iam using 6 structures (each with
8-10 elements) that I pass between the main form and the edit form. These
structures are also passed around in other forms and modules (for saving to
file etc.).
Is there a better way of doing this ? i.e. not using structures etc.
Thank you.
vikrantca Tag: Multiple Item DragDrop w/Listboxes Tag: 77937
Impersonation and SQL Connections
Hello all -
I'm having a problem concerning Impersonation while connecting to SQL
Server. I'm not sure if I'm posting this to the right newsgroups, so let me
know if it belongs elsewhere, and please excuse the cross-post.
I'm writing a Windows Forms application that makes direct calls to a SQL 2k
database. This application requires a user to log in, and confirms their
login and password with whatever they have in Active Directory. I had planned
for the program to use the credentials of the user logged into the
application (NOT Windows) when connecting to the SQL Server, but it seems
I've encountered a slight pitfall.
I've been reading that in this scenario, using simple Identity
Impersonation, the SQL Server will attempt to connect as "NT
AUTHORITY\ANONYMOUS LOGON" because of a limit to the impersonation context.
I'm having trouble believing that this is true. I can impersonate users in
ASP.NET just fine, and connect to databases using those credentials, but am
unable to do the same through a desktop application? It doesn't make all that
much sense, but then again, I'm somewhat of an amateur in this regard.
So, that said, can anyone provide any examples or help to get this working?
I'm happy to provide code samples, I just wasn't sure if it'd be necessary.
Thanks!
Clint Tag: Multiple Item DragDrop w/Listboxes Tag: 77935
Add a small icon to column to signal a sort on this column in list
Hello everybody!
I have a sortable listview control (ie, can click on any column and sort
asc/dec) however I would like to include a small icon, a 'triangle' or
'arrow' indicating that column the sort is on. This is common behaviour
almost everywhere, including the windows explorer.
I have searched everywhere and found little help... does anyone know how to
do this? or if it is possible at all?
Thanks a million!
Greg Tag: Multiple Item DragDrop w/Listboxes Tag: 77932
Getting Text from a RichEdit20a
I am primarily a web developer, but I am branching out for this project into
the world of Windows Forms.
I am looking for any help, examples, samples to show me how to retrieve text
from a RichEdit20a (or RichEdit20w) that exists in another application
running on the same box.
This is the only part of a large project that I am running that is new to
me, so I want to get this sorted as soon as possible. Then I can relax and
concentrate on actually writing the code.
Any help would be appreciated.
Thanks very much.
Matt. Davies
P.S. My apologies for a cross group post, but I wasn't sure which would be
the most appropriate group...inexperience again ! Tag: Multiple Item DragDrop w/Listboxes Tag: 77926
Bigger windows form that screen resolution ??!!
Hi all,
I want to create "the biggest" windows form, but, at design time, I cannot
exceed 1292,972. My maximum screen resolution is 1280/960. I'm using Visual
Studio .NET 2002.
I found this at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsformclasstopic.asp :
The maximum value of this property is limited by the resolution of the
screen the form is running on. The value cannot be greater than 12 pixels
over each screen dimension (horizontal + 12 and vertical + 12).
There is no way to create a bigger form ??
Thanks Tag: Multiple Item DragDrop w/Listboxes Tag: 77921
Master Detail in crystal report
Hello
I have tow tables Requests and Responses there is 2 relations between the 2
tables in 2 fildes Request_Date and Request_No.
I want to display each request folowed by its responses(the request can have
more than one response and differs in the Trial_No)
the Request_No is unique on the day
thnx
moha Tag: Multiple Item DragDrop w/Listboxes Tag: 77918
master detail in crystal report
Hello
I have tow tables Requests and Responses there is 2 relations between the 2
tables in 2 fildes Request_Date and Request_No.
I want to display each request folowed by its responses(the request can have
more than one response and differs in the Trial_No)
the Request_No is unique on the day
thnx
moha Tag: Multiple Item DragDrop w/Listboxes Tag: 77917
Master Detail in crystal report
Hello
I have tow tables Requests and Responses there is 2 relations between the 2
tables in 2 fildes Request_Date and Request_No.
I want to display each request folowed by its responses(the request can have
more than one response and differs in the Trial_No)
the Request_No is unique on the day
thnx
moha Tag: Multiple Item DragDrop w/Listboxes Tag: 77916
Master Detail in crystal report
Hello
I have tow tables Requests and Responses there is 2 relations between the 2
tables in 2 fildes Request_Date and Request_No.
I want to display each request folowed by its responses(the request can have
more than one response and differs in the Trial_No)
the Request_No is unique on the day
thnx
moha Tag: Multiple Item DragDrop w/Listboxes Tag: 77915
DataGrid: Can I use two text lines in the header ?
Hello,
I have some boolean columns in my datagrid. To minimized the column width I
want to change the height of the header row and write the header text in two
lines.
Is this possible ?
How can I do that ?
Thank you
Heinz Tag: Multiple Item DragDrop w/Listboxes Tag: 77913
How do I listen on a directory?
I know it is possible to use a listener on a directory so
that if there is any change I can catch it and update my
application accordingly.
Anybody know or have a code example as for how to do this?
Thanks,
Haim. Tag: Multiple Item DragDrop w/Listboxes Tag: 77906
Handle form closing
I have an MDI form containing child forms. I want to handle form closing to
display a confirmation message when a form is closed or when the main form
is closed. However, the Closing even of the child forms is raised before the
Closing event of the MDI form when you close the MDI form. So, if I catch
the Closing event of the child forms and display a message, then catch the
Closing even of the main form, then I get 2 messages displayed.
Is there a way to know, when a child form is being closed, wether the user
closed the child form or the mdi form?
Thanks
Etienne Tag: Multiple Item DragDrop w/Listboxes Tag: 77897
Re: RE: Deriving the KeyChar on a KeyDown event.
hi?
v-jetan@online.microsoft.com ("Jeffrey Tan[MSFT]") wrote in message news
microsoft.public.dotnet.framework.windowsforms:<1c3Q0qPpEHA.1520@cp
msftngxa06.phx.gbl>...
>Hi Phil,
>
>Does my reply make sense to you? Is your problem resolved?
>
>Please feel free to feedback. Thanks
>
>Best regards,
>Jeffrey Tan
>Microsoft Online Partner Support
>Get Secure! - www.microsoft.com/security
>This posting is provided "as is" with no warranties and confers no rights.
>
------------------------------------------------------------------------------------
Posted from WWWCoder.com (http://www.wwwcoder.com - The Web Developer's Resource site.
Get your free weblog, download free apps, read tutorials, and more. Tag: Multiple Item DragDrop w/Listboxes Tag: 77895
Large Fonts not scaling correctly on tab control.
I have a problem which I have been able to reproduce in a very simple project.
I have a form with a single tabcontrol control with two tab pages. The
tabcontrol's Anchor property is set to Top, Left, Bottom, Right (all 4
directions). On each tabpage, I have a DataGrid. Each DataGrid's Anchor
property is also set to Top, Left, Bottom, Right. I developed this simple
application with my System's DPI setting set to Normal Size (96) and
everything worked perfectly.
The problem came, however, when I changed my DPI setting to Large (120).
The datagrid on the first tabpage (index 0) did not have the correct size
(too large). On the second tabpage (and any others that were present in
subsequent tests), everything was sized correctly.
The same problem happens in reverse (developing in Large and moving to
Normal).
My workaround was to create an empty tabpage at the beginning of the set and
remove it from the tabcontrol's TabPages collection during the form's load
event handler. I could have also not used anchor and changed the control's
width during the form's resize event.
Any non-hack solution or explanation would be appreciated. Tag: Multiple Item DragDrop w/Listboxes Tag: 77893
Datagrid Empty Set
Here is one I am stuggling with:
I have a project I'm developing in VB .NET. I have a datagrid in a window
with two columns. The first column is readonly and the second column is not
and initialized with Zero's. The values in column two must be numeric. How
do I prevent the user from leaving an Empty set in the cell? I already have
a handler that ensures the user enters numeric values. I would like to
default to Zero if the user deletes a value or enters an empty set.
Thankyou,
Jeff Tag: Multiple Item DragDrop w/Listboxes Tag: 77887
Negative Numbers?
Hello,
I have some textboxes that are doing addition:
Dim AString As Double
AString = Convert.ToDouble(TextBox1.Text) - Convert.To(DoubleTextBox2.Text)
TextBox3.Text = AString.ToString("#,##0.00;(#,##0.00);0.00")
When the result is negative it is displayed as "(46)" or whatever the value
is.
This makes it impossible to test for a negative number to make further
additions:
TextBox5.text = Convert.ToDouble(TextBox3.text) +
Convert.ToDouble(Textbox4.text)
Is there a work-around for this? I must have negative numbers that can be
added together.
Thanks,
Chuck Tag: Multiple Item DragDrop w/Listboxes Tag: 77885
Using the same connection over many forms
Hi,
I'm writing a client-server winfroms application, I've notice that every
time I use the wizard to create a bound datagrid, I create a new
sqlconnection.
I wish to create one connection in the main form, and use it in the rest.
(b/c changing something in the connection string - like pwd user or db will
make me go over all the classes now, and find all the connections the wizards
creatred)
what is the best way to do it ?
Regards,
Dani Tag: Multiple Item DragDrop w/Listboxes Tag: 77883
ANN: New Barcode Library from ComponentScience!
Announcement:
ComponentScience is proud to release Barracuda 1.0; our newest .NET
component library for Winforms, ASP.NET and the compact framework!
Use Barracuda to generate Linear, Postal, or 2-dimensional barcodes in your
ASP.NET, Compact framework, and Windows Forms applications. Barracuda 1.0
supports 27 different barcode symbologies with additional support for many
variations.
Creating barcodes with Barracuda is as easy as dropping a control on the
form, picking a symbology, and specifying the data to encode; but the real
power of Barracuda is in its ability to handle the most complex situations
you may encounter with certain barcode symobologies. For example, if you
need to use UCC/EAN-128 mode with the Code128 symbology, Barracuda makes it
easy.
An online demo is available at http://www.ComponentScience.net/Barcodes
For more information, please visit
http://www.ComponentScience.net/Elements/Barracuda
Barracuda includes:
- Support for multiple ASP.NET, Compact Framework, and Windows Forms in
one
package.
- Support for the following symbologies:
- Linear barcodes: Codabar, Code 11, Code 128, Code 13, Code 39, Code 93,
Coop 2 of 5, EAN13, EAN8, IATA 2 of 5, Interleaved 2 of 5,
Matrix 2 of 5, MSI, Pharmacode, Plessey, Standard 2 of 5, Telepen,
UPC A, UPC E.
- Postal barcodes: Australia Post, PLANET, PostNet,
RM4SCC (i.e., UK Royal Mail).
- Two dimensional barcodes: Aztec, Aztec Runes, Code 16K, PDF 417.
Maxicode and DataMatrix coming soon!
- Dynamic barcode image generation.
- Error correction support.
- Printing support.
- Full source code written in C# available. Tag: Multiple Item DragDrop w/Listboxes Tag: 77882
ComboBox woes
I need help solving a couple of problems (and learning a couple of concepts)
involving ComboBox columns in my DataGrid.
The first problem involves my custom ComboBoxColumn class. I don't have
experience making custom classes so I downloaded some code. From what I've
read, it's pretty standard for adding a ComboBox column. It overrides the
Edit, SetColumnValueAtRow, and GetColumnValueAtRow subroutines.
It works great, but it doesn't allow the user to type in custom items in the
combobox. Anything you type in just gets ignored. I want users to be able to
add new items to the database through the comboboxes. I don't understand all
of this code, though, so I'm not sure how to do this. The comboboxes are
bound to datatables, so when the changes are committed I just need to add a
new row with the new text to the datatable. Then when my "Update Database"
button is clicked, the table changes will get sent to the database. It looks
like maybe SetColumnValueatRow is the key subroutine?
The second problem involves the relationship between my query form and my
display form. My query form is a series of ListBoxes bound to certain
DataTables in my DataSet. But before I fill the tables from the database, I
add an item called "All" to the tables so that I can select all items in the
listbox for query purposes. The problem is that the comboboxes in my datagrid
are bound to the same tables, so I have to remove the "All" item before
displaying the datagrid or else "All" will be displayed as a selectable item
in the combobox. This works fine if you use the query form once, but if the
user clicks the "Back" button on the display form I have to put the "All"
item back into the tables for use in the query form. But inserting an item in
a datatable that is already filled doesn't seem to be as trivial as adding a
row to a blank table. Obviously I want "All" to be the first item in the
list, so I can't just tack it on to the end. Right now I have to clear the
tables and refill them, which is taking about 15 seconds. I guess one
solution is to just make copies of the tables and put "All" at the first
index in one of them and bind each listbox and combobox to different tables,
but it seems there should be a more elegant solution. Is there a syntax for
inserting a custom item in a datatable at index 0? Tag: Multiple Item DragDrop w/Listboxes Tag: 77878
Form.Closing event
Hello:
I have a Form that override the OnClosing method to make some actions before
the window is closed, but does not set the Cancel property to let the form
close, assuming that its value by default is false. All was working fine
until I install the service pack 1 of the .Net framework 1.1. The Cancel
property is true and the form remains open. I change my code to assign the
value to false, but I want to know if there is a reason for this behavior.
I check on a new application calling the Close(); method, or clicking on the
close button, and try also with the application main window and with another
window, modal and modeless, in all cases, Cancel property was set to false.
Somebody has an explanation? Tag: Multiple Item DragDrop w/Listboxes Tag: 77877
Validating events not getting fired in TabPage
I have a TabControl with 5 TabPages. I made sure to set
CausesValidation to true everywhere possible. I put Leave and Enter
handles on each page which supposedly will fire each time I'm changing
pages, but for some reason it doesn't work. No events get fired. Has
anyone else encountered this?
Thanks Tag: Multiple Item DragDrop w/Listboxes Tag: 77873
why are my arrow key presses not cought by my mdi child window?
hi all
i have an mdi child form.
i need to catch all key presses.
and indeed all key presses are cought,
however, the arrow keys are not cought.
why are my arrow key presses not cought by my mdi child window?
assaf Tag: Multiple Item DragDrop w/Listboxes Tag: 77867
Problems running .NET apps on other machines
I'm fairly new to distributing .NET applications, and so far no one is able
to use the apps I create. They do run on all 3 of my machines. I include the
dotnetfxredist with the setup files. One person cannot even install the
framework from Windows Update. It's giving them errors and I'm unable to
troubleshoot over the phone. This pretty much blows since I've spent so much
time developing in .NET for my user base and they cannot use it! Is there a
way to convert my app to Windows executable or something? What are my
options?
-Max Tag: Multiple Item DragDrop w/Listboxes Tag: 77866
Distinguish Home key from NumPad Home key?
Hi all,
Does anyone know if it is possible to distinguish between a user
pressing the dedicated Home key versus the Home key on the number pad
(NumPad 7 with NumLock off)? I'm working in VB.NET on WinXP Pro. The
standard KeyPress/Down/Up events return identical key codes. I've tried the
API GetKeyboardState call and I've even tried keyboard hooks as described in
http://www.developer.com/net/net/article.php/11087_2193301_1/
I'm able to accurately determine state of the NumLock key, but NumPad 7 with
the NumLock off appears to generate the same key code as the dedicated Home
key. Has anyone had any experience in this area? I've been looking at this
issue for a while, so it's possible I'm overlooking something simple :)
Thanks,
Jim Tag: Multiple Item DragDrop w/Listboxes Tag: 77865
Application Restart or Reload Urgent....
Does anyone know how to restart an application from itself? Or is there a
way to completely reload an application form code simulating a restart?
Thanks in Advance! Tag: Multiple Item DragDrop w/Listboxes Tag: 77864
How to manualy initiate the event?
Hi,
I would like to know if there in C# an equivalent to the
VB.NET RaiseEvent statement.
I would like to raise an event of a control in my code as
if the user's action provoked it.
Thanks,
Haim. Tag: Multiple Item DragDrop w/Listboxes Tag: 77848
Panel backgroundimage disappear when EnableVisualStyle
I have a panel with a backgroundimage with a docked transparant label. If i
enablevisualstyles the backgroudimage disappear.
Any ideas why?
// Mats Tag: Multiple Item DragDrop w/Listboxes Tag: 77846
Could someone show me an example where I could select multiple items from
one listbox and drag and drop them in another listbox? (C# preferred)