Cursor "stuck" In Databound Control/Caching?
I am having a strange issue and cannot solve it. Basically, I have a form
that edits information in a database. This form has many different controls
that are bound to a business object. When I first load the form to edit
the info everything works properly. The process of loading the object also
loads the object into cache (Isolated storage using Enterprise Library 2.0
caching application block). If I load the form again and attempt to edit
a field (say notes a textbox) my cursor gets "stuck" in the text box and
I cannot click on any other control in the form. However I can close the
form with the X in the upper right corner and the keys still function properly
(Enter saves the object and Esc closes the form). I have looked the stack
trace but it is giving me nothing. I have no idea where to begin. Has anyone
seen something similar or have any ideas what it might be? Any ideas how
I can go about getting some info to solve the problem? Tag: RegEx for Acceptions Numbers with Dot Tag: 89013
Form Display
Hello,
I have designed a form in vb.net. I have placed a tab control with 3
tab pages on the form. This tab control holds many controls in each tab page.
This form is MDIChild form. I have not written much code on the form.
Whenever I run the project, form is dipslayed as textboxes first
then Data grid followed by another tab on the form and so on. Form does not
display all the controls at once as complete form.
What I should do in order to avoid this?
Early response is awaited..
-RbanBph Tag: RegEx for Acceptions Numbers with Dot Tag: 89010
key events doesn't work
Hi.
I got some problem with the key events, they doesn't rise.
first I made a new win project in C#, and I set this.KeyPreview = true; also
this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.fClient_KeyUp);
and then I test run the app, and the keyup event did evoke. then I added a
brower control into the form private AxSHDocVw.AxWebBrowser mviewer; and test
run the app again, but this time the keyup didn't evoke, I assume the the
browser control took the key events, how do I let the parent form evoke the
key events again? and the browser control seems don't have any key event
handler, am i right? any help would be greatful.
regards
Steve p Tag: RegEx for Acceptions Numbers with Dot Tag: 89008
Command button shortcut key
Hi!
i have a form in VB.Net with two command buttons CmdDelete and CmdAdd
i need to add shortcut keys for example F8 for CmdDelete and F4 for CmdAdd
but i don't have any code.
could someone plz show me a sample code...
Best wishes Tag: RegEx for Acceptions Numbers with Dot Tag: 89005
Enter key in Text box
I have a problem while using Enter key in text box.
when user presses enter in the text box information of customer is loaded.
and I have a clear button that clears all the controls on the form.
first it works properly. then I click on some other button (say detail
button) that opens some other form. after closing that form if clear the
form using clear button and again enter Id in text box and press enter. it
does not work instead click event of Detail button is fired.
Again I clear the form and press enter in the text box then it works and
shows the data in controls. It happens several times.
I am able to trace that. Control does not enter in event handler of key
press event when this problem happen.
no error is coming in any of the processes and no default button is set.
Any solutions to this problem?
--
Regards,
Lalit Bhatia Tag: RegEx for Acceptions Numbers with Dot Tag: 89003
Custom Designer
Hi, I'm writing a control called a validating submit button. Basically, you
can tell it to validate a number of controls when the user hits this button.
When they hit the button, it'll say, "You must enter yada yada..." and
highlight the bad field.
Ok, now that I've got that out of the way, I think this problem should be
relatively easy. Basically, I created a special designer that was a form that
had two lists, one of available controls, and one of controls it will
validate, in order. It would then add these items an arraylist of the
inherited button class. This seems to work fine! I can run my custom verb,
have it open up and show all the items that are currently selected to be
validated and all of that jazz, but it doesn't change the actual .vb file in
the InitializeComponent sub of the test form. So basically, it can change all
these values on the design-time copy of the actual control, but I can't
figure out how to add code to the initialize component of the form that'll be
using this control.
I figure that this question ought to be rather easy, as being able to create
a custom designer without being able to "save your changes," so to speak, is
pretty useless, and probably a commonly asked question.
Thanks for your time!
Bryce Covert. Tag: RegEx for Acceptions Numbers with Dot Tag: 89002
Windows XP doesn't restore its desktop background after closing a smart client app
Hi,
I have developed a smart client app and deployed it. In some of the
client machines, they have set a desktop background image. When the
user works with the smart client app and close after opening few
windows forms, the windows xp desktop image have some rectangular
borders all over it which were the size of the opened windows forms in
the smart client. Can anyone tell me how to refresh the desktop
background image in xp?
Thank you. Tag: RegEx for Acceptions Numbers with Dot Tag: 88999
Sometimes clicking on a TreeView node doesn't select it
Hi;
I have this case where when I click on a line in my TreeView, it selects it
for a second, and then moves the selection back to the previous selection.
Usually I have to click 3 times to get it to stick - then it's fine from then
on.
The tree is not set to accept drag/drop. HideSelection=false, otherwaise all
is standard.
This is the only event I have for the control - and it is the only control
in the form:
private void Tree_MouseDown(object sender,
System.Windows.Forms.MouseEventArgs e)
{
TreeNode node = treeDB.GetNodeAt(e.X, e.Y);
if (node == null)
return;
RootNode root = node.Tag as RootNode;
if (root == null)
return;
DoDragDrop(new DragDropData(app, root), DragDropEffects.Copy);
}
Any ideas?
--
thanks - dave Tag: RegEx for Acceptions Numbers with Dot Tag: 88998
How to get user information from the local system user accounts.
I am hoping to be able to (easily) write a program that will go into the
local computer (as long as you are logged in as the administrator) and get
information about the existing user accounts.
I want to do this for LOCAL accounts on computers that are NOT members of a
windows 2000 domain.
Can someone point me to the correct document/example that shows how this
could be done.
I have found many many many examples for Windows 2000 domains, but none for
local system accounts. Tag: RegEx for Acceptions Numbers with Dot Tag: 88996
Smart Client - Update from MSI Code?
What code do I have to add to my application to get it to check for updates,
then re-install itself via an MSI file? Any simple examples out there? Tag: RegEx for Acceptions Numbers with Dot Tag: 88995
Want form on top of, but no in, non-.NET window
Hi;
I used the Win32:SetParent to set the parent of a Form to the Window of the
app it is in (Word). This forced the form to stay within the main window of
Word.
How can I set a Form so it is always above the Word window - but not
restricted to being within it?
--
thanks - dave Tag: RegEx for Acceptions Numbers with Dot Tag: 88994
Want Form.CLose to Hide()
Hi;
I have a modeless form (not modal). I want when the user clicks on the X
that it hides instead of closes. I was going to handle this in the Closing
event but I also need to be able to close the window at some time - so that
won't work.
So, any suggestions?
Also, is there a call I can make on a Form to see if it has been closed?
--
thanks - dave Tag: RegEx for Acceptions Numbers with Dot Tag: 88993
use project variables throughout solution
currently i have a solution with 8 projects.
In the Client project there is a form called ListSer i would like to use in
my Rpts project. Client is the startup project, so can't reference to it.
Is there a way to use the ListSer form in my Rpts project?
Is there a way to create global variables for the Solution? would that work? Tag: RegEx for Acceptions Numbers with Dot Tag: 88988
Dropping Email
i dont know if this is the right group but... i need to know how i can get an
email message that is droped on my form, and manage it content, for example
attachments and other stuff
Thanks Tag: RegEx for Acceptions Numbers with Dot Tag: 88987
custom shaped form
I want to create a small app that uses a jpg as the main form's "face"
(i.e. windows media). I downloaded a sample app from codeproject and
noticed that, in the main code, the developer actually went through and
built up the region with a bunch of AddCurve() and AddLine() calls.
Isn't there a way to accomplish the custom shape by using a transparent
color in the bitmap? Also, what's the best or most common method of
using an image for the form? Thanks,
~billy Tag: RegEx for Acceptions Numbers with Dot Tag: 88985
WinForms and COM Interop
I've a .NET WinForms application. The forms needs to be showed from a VB6
application. I wrote a simple class "COMWrapper" registered for COM Interop
that instances the appropriate form and show it.
The problems appeara when I show a MessageBox from the form. When I press OK
the parent form "disapper". The form has this behavior ONLY with the
ShowInTaskBar = FALSE
Any ideas?
Thanks in advance
Massimo Tag: RegEx for Acceptions Numbers with Dot Tag: 88984
GUI from code
Back in February I asked if anyone knew of a code-based presentation
layer / layout manager. There are two:
MyXAML (http://www.myxaml.com) lets you instantiate components such as
forms and controls through markup rather than code. It uses an XML
markup language (though not Longhorn's MSAvalon). MyXAML is open
source.
CoderForm (http://www.fivetuple.com) takes a different approach by
keeping the UI spec within code, but wrapping the UI classes (Forms,
controls etc) to make it easy to define the interface from code).
Take your pick. Tag: RegEx for Acceptions Numbers with Dot Tag: 88982
Error when committing the row to the original data store
What types of issues cause DataGrid to throw up this message box when
changing a cell value to some new legal cell value, and navigating away
from the row? Tag: RegEx for Acceptions Numbers with Dot Tag: 88980
special line feed character appear in notepad - windows form - c sharp
hello members,
i m using windows form c#
using follwoing code
StreamWriter sw = new StreamWriter(new FileStream(@"c:\anyTextFile.txt",
FileMode.Append));
sw.WriteLine("this is test text \n now from here is next line");
sw.Flush();
sw.Close();
i m trying to write a simple text file, when i open that file in any text pad
it shows data as follow
//**
this is test text
now from here is next line
**//
but when i open that file in windows notepad it shows data as follow
//**
this is test text ? now from here is next line
**//
that is theres sum square box inplace of linefeed,
i want if i open same file in notepad it shows same as of textpad, why it is
not showing, how to overcum that .
regards..
--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/Forums.aspx/winform/200506/1 Tag: RegEx for Acceptions Numbers with Dot Tag: 88978
opening form only one time
Which is the best way to prevent opening a form which is already open?
my program has an mdiparent form and when the user opens frmcustomers, can
edit records.
now if the user again opens this form a new instance will be created and the
same form opens again.
what i can do to prevent this?
I'm using VB .Net and winxp
------------------
Dim myfrm as new frmcustomers
myfrm.show
--------------------
regards Tag: RegEx for Acceptions Numbers with Dot Tag: 88969
Crystal drill down export
Now suppose you have 30 stores located in 4 regions North, South, East, West
and you have a sales report developed in crystal that groups by the region.
You would really like to be able to create 4 export files one for each region.
what would you do.
i don't have a problem exporting the report but how do i create a separate
file for each item in the group?
--
Message posted via http://www.dotnetmonster.com Tag: RegEx for Acceptions Numbers with Dot Tag: 88967
Creating a Simple Updater
Hi
I have in each of my clients Application directory (30) several files and
subfolder sometimes I need to update just a specific .mdb or .txt or .exe or
only the app.config .
I have tried to do something using the UpdatedApplicationBlock but because
of my Directory structure and the variety of files, it seem too much
complicated to me, and I want the update process be done for the person in
front of the PC.
I have my FTP server.
I want to write a little program to do this:
When somebody press the ButtonA:
a) Go to my FTP Site
b) Download the File named myNewFile1.xxx
c) Move c:\MyApp\Dir1\myOldFile.xxx to a backup folder
d) Move myNewFile1.xxx to Directory c:\MyApp\Dir1
I think this is not hard to do, but I need some orientation
Thks Tag: RegEx for Acceptions Numbers with Dot Tag: 88966
Application disappears from Alt-tab task list when displaying CollectionForm
When a CollectionEditor displays a CollectionForm (by clicking on a
Collection in a PropertyGrid) the application icon is no longer shown
in the task list displayed using the Alt-tab key. Any suggestions how
to fix this? Do I need to modify style of CollectionForm to do this?
How can I do this? Tag: RegEx for Acceptions Numbers with Dot Tag: 88963
DragEventArgs and GetDataPresent with abstract base class
Hello:
I am trying to build a drag-and-drop operation with a control derived from
my abstract base class. The control is either a PictureControl or a
PictureGroupControl, both of which have PictureComponentControl as their
superclass.
When handling a DragOver event, I'd like to treat the dragged object as a
PictureComponentControl without having to explicity test for whether the
object is a PictureControl OR a PictureGroupControl, but
GetData/GetFormats/GetDataPresent seem to only work with the subclass, not
with the superclass. I've even tried explicitly casting the object when I
begin the DoDragDrop() operation, but even then it doesn't seem to stick.
Any advice for me? I know I could test for both subclasses explicitly, but
that seems like bad OO -- then, in the future when I invent a
SuperPictureControl, I'll have trouble. Is there a better way to do this,
perhaps using Reflection or an Interface?
Thank you,
/m Tag: RegEx for Acceptions Numbers with Dot Tag: 88958
Validation of data in win forms 2.0, Insert
I am developing an application that requires the user to add and or change
data. The application will be coded in winforms using .net 2.0. I am
struggling a bit to understand how to implement validation of the data. A
simple example is a table the has Description and Remarkscolumn. The
Description is a required field. It must be non blank.
I have implemented a dataset for this table and have implemented validation
in the OnColumnChanging event in the datasets partial class. I have wired
this into an errorprovider component on the winform. THis works as I
expected on an update. The validation logic successfully finds the blank
column and stops the user from entering a blank value.
An insert does not work as I expected. The OnColumnChanging event does not
seem to get fired on an insert.
Any help would be appreciated. Tag: RegEx for Acceptions Numbers with Dot Tag: 88955
IDisposable objects as fields in a Windows Form
Hi to all.
I have a Windows Form.
I have a field in my form class which implements IDisposable.
When I should call Dispose to that object?
Is correct to call Dispose of all IDisposable objects in the OnClosed method
of the form?
Thanks,
Pino. Tag: RegEx for Acceptions Numbers with Dot Tag: 88952
Event Log?
Hi all,
I've written a window service which needs to write to the event log from
time to time based on certain events.
Apart from a minor issue at the moment where the actual log isn't created
and it uses the "Application" one, I always get the following:
"For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp."
added to the bottom of each of my "information" type event log entries.
As you are aware there are the following types:
Error
FailureAudit
Information
SuccessAudit
Warning
Does anyone know of any way to either turn off that line from the log entry,
or, add my own 'types' to the event log types so that I can use my own
"RobsInformation" for example as a type that doesn't display that
surpurflous link....
Any information would be really appreciated.
I have other applications (obviously), installed on my PC, and things like
Norton AV write to the event log with "information" type entries, but they
dont have URL's back to MS. In an ideal scenario here I'd be able to add my
own URL pointing to a web page that gives details of the error message (as
MS do).
Thanks in advance for any help.
Regards
Rob Tag: RegEx for Acceptions Numbers with Dot Tag: 88950
CD-ROM suspends the application execution
Hi to all.
I'm writing an application which should read data from CD-ROM.
I have the application started and I I insert the CD-ROM in the reader.
Subsequently, I click the button for read the data, but the Windows Form not
respond for a couple of seconds.
Are there any methods to read the CD-ROM in the background without having
the form in not responding status?
This is the same problem when I insert the CD-ROM in Windows Explorer...
Thanks,
Pino. Tag: RegEx for Acceptions Numbers with Dot Tag: 88946
Transparent Label Control - Text Refresh Problem
I have created a class file for Transparent Label and it works. But
when I placed the control in the form designer, the text inside the
label is not displayed. I have to move the control or press ALT+TAB to
refersh the text. Any tips to overcome this problem?
My Code:
Imports System
Imports System.Windows.Forms.Design
Imports System.ComponentModel
Imports System.ComponentModel.Design
Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Drawing.Text
Imports System.Windows.Forms
Public Enum Direction
' Fields
AntiClockwise = 1
Clockwise = 0
End Enum
Public Enum Orientation
' Fields
Arc = 1
Circle = 0
Rotate = 2
End Enum
Public Class DesignStaticText
Inherits System.Windows.Forms.Control
' Fields
Private m_rotationAngle As Double
' Private text As String
Private m_textDirection As Direction
Private m_textOrientation As Orientation
<Bindable(False), Browsable(False)> Public Shadows Property
Visible() As Boolean
Get
Return MyBase.Visible
End Get
Set(ByVal Value As Boolean)
MyBase.Visible = Value
End Set
End Property
Public Sub New()
MyBase.SetStyle(ControlStyles.SupportsTransparentBackColor,
True)
Me.m_rotationAngle = 0
Me.m_textOrientation = Orientation.Rotate
Me.BackColor = Color.Transparent
End Sub
Public Sub InvalidateEx()
If (Not MyBase.Parent Is Nothing) Then
Dim rect As Rectangle
rect = New Rectangle(MyBase.Location, MyBase.Size)
MyBase.Parent.Invalidate(rect, True)
Else
End If
Invalidate()
End Sub
Protected Overrides Sub OnFontChanged(ByVal e As EventArgs)
Me.InvalidateEx()
End Sub
'Protected Overrides Sub OnLocationChanged(ByVal e As EventArgs)
' Me.InvalidateEx()
'End Sub
Protected Overrides Sub OnPaintBackground(ByVal pevent As
PaintEventArgs)
End Sub
' Properties
Protected Overrides ReadOnly Property CreateParams() As
CreateParams
Get
Dim params As CreateParams = MyBase.CreateParams
params.ExStyle = (params.ExStyle Or 32)
Return params
End Get
End Property
<Description("Rotation Angle"), Category("Appearance")> _
Public Property RotationAngle() As Double
Get
Return m_rotationAngle
End Get
Set(ByVal value As Double)
m_rotationAngle = value
InvalidateEx()
'MyBase.Invalidate()
End Set
End Property
<Category("Appearance"), Description("Direction of the Text")> _
Public Property TextDirection() As Direction
Get
Return m_textDirection
End Get
Set(ByVal value As Direction)
m_textDirection = value
'MyBase.Invalidate()
InvalidateEx()
End Set
End Property
<Category("Text"), Description("Text to display")> _
Public Overrides Property Text() As String
Get
Return MyBase.Text
End Get
Set(ByVal value As String)
MyBase.Text = value
InvalidateEx()
End Set
End Property
<Category("Appearance"), Description("Kind of Text Orientation")> _
Public Property TextOrientation() As Orientation
Get
Return m_textOrientation
End Get
Set(ByVal value As Orientation)
m_textOrientation = value
InvalidateEx()
End Set
End Property
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
Dim i As Integer
Dim graphics As Graphics = e.Graphics
graphics.SmoothingMode = SmoothingMode.HighQuality
graphics.TextRenderingHint = TextRenderingHint.AntiAlias
Dim stringFormat As StringFormat = New StringFormat
stringFormat.Alignment = StringAlignment.Center
stringFormat.Trimming = StringTrimming.None
Dim textBrush As Brush = New SolidBrush(Me.ForeColor)
'Getting the width and height of the text, which we are going
to write
Dim width As Single = graphics.MeasureString(Text,
Me.Font).Width
Dim height As Single = graphics.MeasureString(Text,
Me.Font).Height
'The radius is set to 0.9 of the width or height, b'cos not to
'hide and part of the text at any stage
Dim radius As Single = 0.0F
If (ClientRectangle.Width < ClientRectangle.Height) Then
radius = ClientRectangle.Width * 0.9F / 2
Else
radius = ClientRectangle.Height * 0.9F / 2
End If
Select Case (m_textOrientation)
Case Orientation.Arc
'Arc angle must be get from the length of the text.
Dim arcAngle As Single = (2 * width / radius) /
Text.Length
If (TextDirection = Direction.Clockwise) Then
For i = 0 To Text.Length - 1
graphics.TranslateTransform(CType((radius * (1
- Math.Cos(arcAngle * i + RotationAngle / 180 * Math.PI))), Single),
CType((radius * (1 - Math.Sin(arcAngle * i + RotationAngle / 180 *
Math.PI))), Single))
graphics.RotateTransform((-90 +
CType(RotationAngle + 180 * arcAngle * i, Single)) / CType(Math.PI,
Single))
graphics.DrawString(Text.Chars(i).ToString(),
Me.Font, textBrush, 0, 0)
graphics.ResetTransform()
Next
Else
For i = 0 To Text.Length - 1
graphics.TranslateTransform(CType((radius * (1
- Math.Cos(arcAngle * i + RotationAngle / 180 * Math.PI))), Single),
CType((radius * (1 + Math.Sin(arcAngle * i + RotationAngle / 180 *
Math.PI))), Single))
graphics.RotateTransform((-90 -
CType(RotationAngle - 180 * arcAngle * i, Single) / CType(Math.PI,
Single)))
graphics.DrawString(Text.Chars(i).ToString(),
Me.Font, textBrush, 0, 0)
graphics.ResetTransform()
Next
End If
Exit Select
Case Orientation.Circle
If (TextDirection = Direction.Clockwise) Then
For i = 0 To Text.Length - 1
graphics.TranslateTransform(CType((radius * (1
- Math.Cos((2 * Math.PI / Text.Length) * i + RotationAngle / 180 *
Math.PI))), Single), CType((radius * (1 - Math.Sin((2 * Math.PI /
Text.Length) * i + RotationAngle / 180 * Math.PI))), Single))
graphics.RotateTransform(-90 +
CType(m_rotationAngle, Single) + (360 / Text.Length) * i)
graphics.DrawString(Text.Chars(i).ToString(),
Me.Font, textBrush, 0, 0)
graphics.ResetTransform()
Next
Else
For i = 0 To Text.Length - 1
graphics.TranslateTransform(CType((radius * (1
- Math.Cos((2 * Math.PI / Text.Length) * i + RotationAngle / 180 *
Math.PI))), Single), CType((radius * (1 + Math.Sin((2 * Math.PI /
Text.Length) * i + RotationAngle / 180 * Math.PI))), Single))
graphics.RotateTransform(-90 -
CType(m_rotationAngle, Single) - (360 / Text.Length) * i)
graphics.DrawString(Text.Chars(i).ToString(),
Me.Font, textBrush, 0, 0)
graphics.ResetTransform()
Next
End If
Exit Select
Case Orientation.Rotate
'For rotation, who about rotation?
Dim angle As Double = (RotationAngle / 180) * Math.PI
graphics.TranslateTransform((ClientRectangle.Width +
CType((height * Math.Sin(angle)), Single) - CType((width *
Math.Cos(angle)), Single)) / 2, (ClientRectangle.Height - CType((height
* Math.Cos(angle)), Single) - CType((width * Math.Sin(angle)), Single))
/ 2)
graphics.RotateTransform(CType(RotationAngle, Single))
graphics.DrawString(Text, Me.Font, textBrush, 0, 0)
graphics.ResetTransform()
Exit Select
End Select
End Sub
Protected Overrides Sub OnLocationChanged(ByVal e As
System.EventArgs)
MyBase.OnLocationChanged(e)
If Not IsNothing(Me.Parent) Then
Me.Parent.Refresh()
End If
End Sub
End Class
Thanks
Prabu Raju Tag: RegEx for Acceptions Numbers with Dot Tag: 88942
Controls layout save/load
Hi
Is there a way to save the layout of controls (position, size, visibility,
appearance etc.) to a file (xml?) and also be able to load the layout from a
file? The idea being that these file scan serve as templates for different
clients who may have different preferences.
Is someone has worked with this and can post some code examples then that
would be highly appreciated.
Thanks
Regards Tag: RegEx for Acceptions Numbers with Dot Tag: 88940
URGENT: printer control from code
hi there..
i want to scroll down printer after printed a page can anyone help me?
thanks... Tag: RegEx for Acceptions Numbers with Dot Tag: 88936
Property with browsable = true does not show in Properties
This is my first attempt to create a custom control. I have set the Browsable
attribute (see below)and rebuilt the application but I cannot get the
property to show on the Properties form. The control and all that it inherits
from Control do show.
Am I missing something?
Thanks, Nigel B
<Description("The size of the label shown in the client area"),
Category("Appearance"), Browsable(True)> _
Public Property LabelSize(ByVal pSize As Size) As Size
Get
Return mLabelRealSize
End Get
Set(ByVal pValue As Size)
ChangeLabelSize(pValue)
End Set
End Property
--
Nigel Barton Tag: RegEx for Acceptions Numbers with Dot Tag: 88931
Problems editing datagrid bound to altered datatable
I have loaded a DataTable from SQL server table via SQLDataAdapter as a
basis.
Once filled, I add columns that are calculated, and found via other
methods. This includes tooltip text specific to the row, row foreground
and background colors, and data parsed from text files on disk. And even
artificial rows to indicate to the user where there are missing database
records. I bind the datasource/datatable to a DataGrid.
The display comes up fine. I try to edit some cell, expecting it to ONLY
update the in-memory dataset/datatable, and I get this message box when
run outside the IDE:
Error when committing the row to the original data store.
Object reference not set to an instance of an object. Do you want to
corret the value? [yes] [no]
BTW - When run in the IDE in DEBUG It merely throws an exception, shows
3 threads, each with no call stack. I have to run without the debugger
in order to get this message box which at least gives some clues I don't
understand, rather than no clues at all.
Is this because of the extra columns and/or extra rows I may have added
SINCE the fill? I observe it happens REGARDLESS of adding extra rows. If
so, does this mean I must create my own IList for binding, or such, or
is there some way of ferreting out the cause for the error.
Also, I notice I get errors of this nature when trying to enter invalid
dates, for example. I need to take control of the data posting. I will
be responsible for programmatically updating SQL when the user is done.
Anything you can point me to to get my head wrapped around this would be
greatly appreciated. I would like to take more control of cell data
validation. Tag: RegEx for Acceptions Numbers with Dot Tag: 88926
Process.Start() and winword
Hi all,
I launch documents (whatever extension) with the following code:
System.Diagnostics.ProcessStartInfo startInfo = new
ProcessStartInfo(attachmentFilePath);
editAttachmentProcess = Process.Start(startInfo);
This works fine for a number of document types/applications.
However, if the file is a .doc and Word is launched, the "process" variable
gets a value only if Word was not running already because Word will open
documents in an existing instance.
The problem is that the variable "editAttachmentProcess" is null when
launching a .doc and Word was running already. I wish to manipulate the
Process (e.g. attaching an event handler to .Exited etc.) - what is the best
way to get the process that the document was opened in, given that a new
instance might not have actually started?
I thought of the following approach:
1) Get the application that is associated with the extension via Win32 calls
2) Cycle through all the processes (Process.GetProcesses), then cycle
through each open window in the process to see if document is open therein.
Any other ideas/suggestions?
Regards
Joubert Tag: RegEx for Acceptions Numbers with Dot Tag: 88921
datagrid tablestyles problem
Hi,
Im Sure this is a standard question and one of those its easy if you know how.
Basically I am returning a dataset from sql server with five fields but only
want to display to columns in my datagrid populated from two fields from the
dataset
So ive
a) created a grid datagridstyle
b) Ive created a datatable to map the data from my dataset
c) Ive retrieved the data from sql server and copied the appropriate fields
to the grids datatable
It appears that all the styles are being ingnored and all the data from the
sql data set are being displayed
Any Ideas ?
Code included TIA
Private objEventParamDT As New DataTable("eventParamDT")
Private Sub populate_eventParams(ByVal p_nIdEvent As Integer)
Dim objDataSet As DataSet
Dim objEventParamRow, objDataRow As DataRow
Try
objDataSet = objEvent.getEventArgList(p_nIdEvent)
Call create_eventParamDataTable()
Call create_EventParamsGrid()
For Each objDataRow In objDataSet.Tables("results").Rows
objEventParamRow = objEventParamDT.NewRow
objEventParamRow("argSeq") = objDataRow("argSeq")
objEventParamRow("argDesc") = objDataRow("argDesc")
objEventParamDT.Rows.Add(objEventParamRow)
Next
With dgEventParams
.DataMember = "eventParamDT"
.DataSource = objEventParamDT
End With
MsgBox(dgEventParams.TableStyles.Item(0).GridColumnStyles.Item(0).HeaderText)
Catch ex As Exception
setStatus(ex.Message)
End Try
End Sub
Private Sub create_eventParamDataTable()
Dim nLeventId As New DataColumn("idLeventArg", GetType(Integer))
Dim nSeq As New DataColumn("argSeq", GetType(Integer))
Dim cArgDesc As New DataColumn("argDesc", GetType(String))
With objEventParamDT
' .Columns.Add(nLeventId)
.Columns.Add(nSeq)
.Columns.Add(cArgDesc)
End With
End Sub
Private Sub create_EventParamsGrid()
Dim gts As New DataGridTableStyle
dgEventParams.TableStyles.Clear()
gts.MappingName = "EventParamData"
' Set other properties.
gts.AlternatingBackColor = Color.LightGray
' Add a GridColumnStyle and set its MappingName
' to the name of a DataColumn in the DataTable.
' Set the HeaderText and Width properties.
' Dim txtEventId As New DataGridTextBoxColumn
' With txtEventId
' .MappingName = "idLeventArg"
' .HeaderText = ""
' .Width = 0
' .ReadOnly = True
' End With
'
Dim txtSeq As New DataGridTextBoxColumn
With txtSeq
.HeaderText = "Seq"
.MappingName = "argSeq"
.Width = 10
.ReadOnly = True
End With
gts.GridColumnStyles.Add(txtSeq)
Dim txtDesc As New DataGridTextBoxColumn
With txtDesc
.HeaderText = "Description"
.MappingName = "argDesc"
.Width = 200
.ReadOnly = True
End With
gts.GridColumnStyles.Add(txtDesc)
With dgEventParams
.TableStyles.Add(gts)
.CaptionText = "Event Parameters"
End With
End Sub Tag: RegEx for Acceptions Numbers with Dot Tag: 88919
Apply a theme to a dot net application
Hi,
I want to know if it is possible to apply a custom made skin/xp theme
to an individual dot net application.
What I am trying to do is create a new skin\xp theme (e.g. Different
style scroll bars) and then get my dot net application to use this.
This way no other applications are compromised.
Does anyone know if this is possible and if so how?
Thanks
Glen Tag: RegEx for Acceptions Numbers with Dot Tag: 88918
Get Windows icons for files in a ListView?
Let's say I know a file extension and I want to get the Windows icon for
that type of file, and put that icon in the image for an item in a list
view. Would this be possible without loading all possible Windows icons
into the image list at compile time? In other words, is there a way to
dynamically put in the image for a list view item at runtime, and get it
from Windows based on the extension type? Tag: RegEx for Acceptions Numbers with Dot Tag: 88917
Having trouble with simple data binding
Hello,
I have two labels, call them leftLabel and rightLabel, that start off next
to each other. leftLabel has its autosize property set to true. What I am
trying to do is bind rightLabel.Left to leftLabel.Right so that whenver the
autosizing label changes size due to longer text, the right label will always
be drawn right after it.
I started an empty form and added the two labels. Then I have in the
constructor:
public Form1()
{
InitializeComponent();
rightLabel.DataBindings.Add("Left",leftLabel,"Right");
}
I also have a textbox and in its text changed event I just set leftLabel's
text to whatever is in the text box.
The thing is, eventhough leftLabel changes size, and its Right property is
changed, rightLabel does not move.
What am I doing wrong?
Thanks,
-Flack Tag: RegEx for Acceptions Numbers with Dot Tag: 88913
Problem with advanced Master-Detail grids
Okay, I'm having an issue I'm hoping you can help me with.
I have two datagrids in a Master-Detail relationship. The top is vehicles,
the bottom is a mileage log. The mileage log should only show the entries
for the vehicle selected in the vehicles grid.
Here's the standard way that I keep finding to set up this scenario:
1) add a relationship to the DataSet,
2) set the master grid's DataSource to the DataSet, and set it's DataMember
to the master table in the dataset
3) set the detail grid's DataSource to the DataSet, and set it's DataMember
to the relationship
Voila, supposedly.
The problem is, I can't let people add records to the master grid using the
append row. Instead, I have Add, Edit, and Delete buttons that do the
appropriate action through a different form. To disable the Append row, you
have to create a DataView for your master grid and set it's AllowAddNew
property to false. Fine, but if my master grid is bound to the DataView
instead of directly to the dataset, it gets it's own CurrencyManager, which
means the detail grid won't stay syncronized with the selection in the
master grid.
To get around this, I've hooked into the PositionChanged event of the
DataView that controls my master form. In that event handler, I set the
RowFilter property of the DataView to which my detail form is bound. That
filters the visible rows down to the ones matching the selected record in
the master grid.
This solution creates another problem, though, because now when I add a
detail row using the DataGrid's append row, it doesn't have any knowledge of
the relationship, so it doesn't fill in the parent ID correctly. I'm getting
around this problem by hooking in to the ColumnChanged event of the
DataTable that represents the detail table. That code looks like this
(remember that GasMileageLog is the detail table, and Vehicles is the parent
table):
private void GasMileageLog_ColumnChanged(object sender,
DataColumnChangeEventArgs e)
{
DSMileage.GasMileageLogRow row = (DSMileage.GasMileageLogRow)e.Row;
DataColumn col = e.Column;
// set VehicleID to the currently selected vehicle if it is unset
if ( row.IsVehicleIDNull() )
{
CurrencyManager cm = (CurrencyManager)BindingContext[dvVehicles];
DSMileage.VehiclesRow vrow =
(DSMileage.VehiclesRow)((DataRowView)cm.Current).Row;
row.VehicleID = vrow.VehicleID;
}
}
Now, this almost works. It's so close I can taste it. But there's one more
problem.
Remember how I said you modify records in the master table with Add, Edit,
and Delete buttons? Well, if you use the Add button to add a new record into
the master table, the ID that .NET generates for it isn't the actual ID that
gets written into the database. This is good, because .NET doesn't know what
IDs are actually in the database, and we don't want it to cause collisions.
But it's bad, because when I try to use the above code to write a new detail
record that should be related to a master record that hasn't been written
into the database, the detail records end up associated with nothing once
everything is saved to the database with the adapter.Update() method.
Granted, I could get rid of my problem entirely by having the Add button
save directly to the database. But so far, the whole thing is playing nicely
with disconnected datasets, so I have cancel buttons that abandon all the
changes up to now, including any new master records and any changes or
additions to the detail records. I'd really like to keep it that way if at
all possible.
And this has got to be possible. I'm open to alternate approaches. If I need
to go back to using the relationship instead of syncing the detail records
to the master records manually, that's fine, but I will need to know how to
turn off the append row without using a dataview. Either that, or I'll need
to know how to hook a dataview up to a relationship. So far, I haven't found
a way to do either of those things.
Any ideas?
Charlie Kilian
ckilian@lutzsoftware.com Tag: RegEx for Acceptions Numbers with Dot Tag: 88912
Information on which application has focus
Hi,
Bit of a newbie question, but is it possible from the .net framework,
to gather information on which application (managed or otherwise)
currently has GUI focus?
Thanks. Tag: RegEx for Acceptions Numbers with Dot Tag: 88910
App Architecture question ?
Hello,
Iam starting on an application for an heat exchanger design.
At the core, is a numerical solver that takes the HXInput instance and
returns an HXResults instance. HXInputs is as follows :
class HXInput
{
private HXAir mAir;
private HXFin mFin;
......
// and so on.
}
Each of those HXAir and HXFin classes are huge, and contain info of the
order of double [200, 200]
Current design :
# 1 SDI main form, that shows some info from HXInputs
# 1 UI process controller that holds an instance of HXInputs, and the
solver. The SDI form has an instance of UIP and sends menu commands to the
UIP. Then the UIP shows different forms for editing information in HXInputs.
# N different dialogs to display/edit different information in HXInputs and
also a Tab page on SDI with results to show after the simulation is run.
Heres the twist -
There are dependencies between the data shown by different forms. Meaning -
if one forms changes something in HXInputs, that affects some other UI
options on other forms, or they need to be reflected on the main SDI window.
What kind of architecture/pattern should be used for this app ? Iam looking
for something that would allow easy addition of new data in HXInputs.
I understand that this is too complex to explain, without figures, but would
very much appreciate any advice.
thank you.
vikrantca Tag: RegEx for Acceptions Numbers with Dot Tag: 88909
custom editor for TreeView nodes
Hello you,
I need Your HELP.
I have my own TreeView Nodes Editor, in order to add 'MyTreeNode'', like
node which are ComboBox and so.
I have two classes. one inherit from 'TreeView' and the other from 'TreeNode'.
In 'MyTreeView' i override 'Nodes' (keyword- new) in order to open my custom
editor.
In public partial class MyTreeView : TreeView, I use the next statement:
[
DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
Editor(typeof(NodesTypeEditor), typeof(UITypeEditor)),
]
new public TreeNodeCollection Nodes
{
get { return base.Nodes; }
set
{
TreeNode[] myTreeNodeArray = new
TreeNode[((TreeNodeCollection)value).Count];
((TreeNodeCollection)value).CopyTo(myTreeNodeArray, 0);
((TreeNodeCollection)value).Clear();
this.Nodes.AddRange(myTreeNodeArray);
}
}
but the DesignerSerializationVisibility create the next code, which produce
casting error on run time:
MyCheckTreeNode myCheckTreeNode1 = ((MyCheckTreeNode)(new
TreeNode("TreeNode")));
I need it to be :
MyCheckTreeNode myCheckTreeNode1 = new MyCheckTreeNode("TreeNode");
In the editor i use TreeView and PropertyGrid. the code in 'Add CheckBox
Node' is:
treeView1.Nodes.Add(new MyCheckTreeNode("TreeNode"));
How can i fix it???
Please Help me. I need it fast.
Thanks,
Ran S' Tag: RegEx for Acceptions Numbers with Dot Tag: 88906
(Rich)TextBox, scrolling, HideSelection
Hi-
In my application I have a RichTextBox, and I want to scroll it so that
the character at a given index appears on the top line of the box. Up
till now, I've used this routine, which works fine:
==
rtb.Focus();
rtb.SelectionStart=rtb.Text.Length-1;
rtb.SelectionLength=0;
rtb.SelectionStart=rtb.Text.IndexOf("MY_TEXT");
rtb.SelectionLength=0;
==
However, recently I've been adding a search feature, and as a result
I've needed to set the RTB's HideSelection property to false. An
unfortunate side-effect of this is that for some reason the above code
no longer works. I've experimented with ScrollToCaret combinations, but
the problem is that if MY_TEXT is visible on-screen but half-way down
the textbox, then calling ScrollToCaret will never move the box.
Does anyone have a solution?
Cheers,
Andy Tag: RegEx for Acceptions Numbers with Dot Tag: 88901
How to create wizards?
Hi;
I know it's probably in the one place I didn't look but I have been over the
docs and several books trying to find how to create a form that is a wizard
and can't find it. How do I set up a wizard?
--
thanks - dave Tag: RegEx for Acceptions Numbers with Dot Tag: 88895
Forms Icon: The argument 'picture' must be a picture that can be used as a Icon.
At designtime I can assingn a Form's Icon property to a .png file. In the
generated code I see:
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
when I do this with the designer.
I would like to make this assignment at runtime. I added two .png files to
my Project and set them as Embedded Resources. I load the embedded resource
in the below method inside the Form:
Function GetEmbeddedIcon(ByVal strName As String) As System.Drawing.Icon
Dim stream As System.IO.Stream
Dim assm As System.Reflection.Assembly = Me.GetType().Assembly
stream =
assm.GetManifestResourceStream("CustomDataSystems.AMNET.Forms.Maintenance.UIElements"
& "." & strName)
Me.Icon = New System.Drawing.Icon(stream)
End Function
Where strName is the name of the png file.
I get:
"An unhandled exception of type 'System.ArgumentException' occurred in
system.drawing.dll
Additional information: The argument 'picture' must be a picture that can be
used as a Icon."
This implies to me you cannot assing a .png file to the Form's Icon
property, though I can do this at designtime and I see the icon.
Any idea what I am doing wrong here? Tag: RegEx for Acceptions Numbers with Dot Tag: 88892
Does click event handler need to marshal onto main thread?
If I have a form with a button and add a button_Click event handler,
and within that handler I update the form's GUI, do I need to marshal
onto the main thread?
i.e. Do I need to do this:
private void button1_Click(object sender, System.EventArgs e)
{
if (InvokeRequired)
{
Invoke(new EventHandler(button1_Click),
new object[] {sender, e});
}
else
{
button1.Text = "stuff";
}
}
I think what I'm asking is:
Can form event handlers be on a different thread from the main thread?
Any clarifcation on this appreciated!
Boz Tag: RegEx for Acceptions Numbers with Dot Tag: 88886
FindForm() returns nothing
This is a multi-part message in MIME format.
------=_NextPart_000_0022_01C56CCF.58179DE0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I have a control class that inherits from ComboBox. The intention of =
the constructor is to grab a reference to the BaseForm class of the form =
containing the custom control and populate its members using cached data =
from a "ClientCache" dataset in the base form. The constructor:
Public Sub New()
Me.Name =3D "cboItems"
Dim bf As BaseForm =3D CType(Me.FindForm(), BaseForm)
Me.DataSource =3D bf.ClientCache.Tables("MyItems")
End Sub
The code always dies on line 3 because Me.FindForm() always returns =
Nothing, even though the combobox control is being used by a windows =
form. (All our forms inherit from BaseForm, which inherits =
Windows.Form.)
VS.NET help indicates that FindForm "retrieves the form that the control =
is on". But from all indications this is not the case.
Thoughts?
TIA.
Mark
------=_NextPart_000_0022_01C56CCF.58179DE0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1498" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>I have a control class that inherits =
from=20
ComboBox. The intention of the constructor is to grab a reference =
to the=20
BaseForm class of the form containing the custom control and=20
populate its members using cached data from a "ClientCache"=20
dataset in the base form. The constructor:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>
<DIV>
<P><FONT size=3D2><FONT face=3D"Courier New"><FONT =
color=3D#0000ff>Public</FONT> <FONT=20
color=3D#0000ff>Sub</FONT> <FONT =
color=3D#0000ff>New</FONT>()</FONT></FONT></P>
<P><FONT size=3D2><FONT face=3D"Courier New"><FONT =
color=3D#0000ff> =20
Me</FONT>.Name =3D "cboItems"</FONT></FONT></P>
<P><FONT size=3D2><FONT face=3D"Courier New"><FONT =
color=3D#0000ff> =20
Dim</FONT> bf <FONT color=3D#0000ff>As</FONT> BaseForm =3D <FONT=20
color=3D#0000ff>CType</FONT>(<FONT color=3D#0000ff>Me</FONT>.FindForm(), =
BaseForm)</FONT></FONT></P>
<P><FONT size=3D2><FONT face=3D"Courier New"><FONT =
color=3D#0000ff> =20
Me</FONT>.DataSource =3D =
bf.ClientCache.Tables("MyItems")</FONT></FONT></P>
<P><FONT size=3D2><FONT face=3D"Courier New"><FONT =
color=3D#0000ff>End</FONT> <FONT=20
color=3D#0000ff>Sub</P></FONT></FONT></FONT></DIV></FONT></DIV>
<DIV>
<P><FONT size=3D2><FONT face=3D"Courier New"><FONT color=3D#0000ff><FONT =
face=3DArial=20
color=3D#000000>The code always dies on line 3 =
because Me.FindForm()=20
always returns Nothing, even though the combobox control is being =
used by a=20
windows form. (All our forms inherit from BaseForm, which inherits=20
Windows.Form.)</FONT></FONT></FONT></FONT></P>
<P><FONT size=3D2><FONT face=3D"Courier New"><FONT color=3D#0000ff><FONT =
face=3DArial=20
color=3D#000000>VS.NET help indicates that FindForm "retrieves the form =
that the=20
control is on". But from all indications this is not the=20
case.</FONT></FONT></FONT></FONT></P>
<P><FONT size=3D2><FONT face=3D"Courier New"><FONT color=3D#0000ff><FONT =
face=3DArial=20
color=3D#000000>Thoughts?</FONT></FONT></FONT></FONT></P>
<P><FONT size=3D2><FONT face=3D"Courier New"><FONT color=3D#0000ff><FONT =
face=3DArial=20
color=3D#000000>TIA.</FONT></FONT></FONT></FONT></P>
<P><FONT size=3D2><FONT face=3D"Courier New"><FONT color=3D#0000ff><FONT =
face=3DArial=20
color=3D#000000>Mark</FONT></P></FONT></FONT></FONT></DIV></BODY></HTML>
------=_NextPart_000_0022_01C56CCF.58179DE0-- Tag: RegEx for Acceptions Numbers with Dot Tag: 88880
Hi
using regEx class in c# can u tell me how to accept input string [0-9] and
also accepting [dot][.] with 'n' times