Integer Number -> Text Number
All,
I have a form that currently displays an integer value in a label to a user
but want it to now display the text equivalent. For example, if I have 54,
it should say fifty four. Any class examples on doing this or should I just
do it with a case function? Not to be picky, but....Ideas in VB would be
best.
Thanks,
Brian Tag: Executable's path Tag: 112752
KB928365 and ClickOnce
Hi All,
Sorry i'm new to this so i hope this is the correct section. I know
KB928365 has been beaten to death but i have encounted a differnet issue.
(And have not been able to find a thread that talks about it) It seem that
once i installed the new security patch all my applactions that check for
updates now fail with the error Application cannot be started. I cannot even
install using the Publish.htm. I always get the error. Contact the
applicaiton vendor. When i click the details i see:
PLATFORM VERSION INFO
Windows : 5.1.2600.131072 (Win32NT)
Common Language Runtime : 2.0.50727.832
System.Deployment.dll : 2.0.50727.832 (QFE.050727-8300)
mscorwks.dll : 2.0.50727.832 (QFE.050727-8300)
dfdll.dll : 2.0.50727.42 (RTM.050727-4200)
dfshim.dll : 2.0.50727.42 (RTM.050727-4200)
SOURCES
Deployment url : http://y8zg843m/test/test.application
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later
in the log.
* Activation of http://y8zg843m/test/test.application resulted in
exception. Following failure messages were detected:
+ Object reference not set to an instance of an object.
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [2007/07/26 2:12:40 PM] : Activation of
http://y8zg843m/test/test.application has started.
ERROR DETAILS
Following errors were detected during this operation.
* [2007/07/26 2:12:40 PM] System.NullReferenceException
- Object reference not set to an instance of an object.
- Source: System.Deployment
- Stack trace:
at
System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
at
System.Deployment.Application.FileDownloader.Download(SubscriptionState
subState)
at
System.Deployment.Application.DownloadManager.DownloadManifestAsRawFile(Uri&
sourceUri, String targetPath, IDownloadNotification notification,
DownloadOptions options, ServerInformation& serverInformation)
at
System.Deployment.Application.DownloadManager.DownloadDeploymentManifestDirectBypass(SubscriptionStore
subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState,
IDownloadNotification notification, DownloadOptions options,
ServerInformation& serverInformation)
at
System.Deployment.Application.DownloadManager.DownloadDeploymentManifestBypass(SubscriptionStore
subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState,
IDownloadNotification notification, DownloadOptions options)
at
System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut)
at
System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.
Now this is happening regarless of the application C# VB. This test
application only has a lable. When i remove the patch everything works just
fine. Anyone else seeing this issue? Tag: Executable's path Tag: 112751
Character spacing when printing
Hi everybody.
I've been searching but I can't find if is it possible and, if so, how
to set the space between characters (I have to fill in a already printed
form and every single character must fall in its own little square).
I thought it was possible to set something with System.Drawing.Fon, but
nothing seems to work...
Hope someone could help me.
Thank you very much,
Lorezo Tag: Executable's path Tag: 112750
WFP, WF, WCF and CAB
Is the introduction of these new technologies going to change the way that
CAB works or will CAB still use basically the same architecture?
Bill Tag: Executable's path Tag: 112749
Sent Crystal Report as pdf via Outlook
Hi,
is it possible to sent an Crystal report as pdf file via outlook in code??
does someone have a code snippet to get me started??
Thx!!
--
Best regards
Luc N Tag: Executable's path Tag: 112748
Setup Project Question: Validating user input within UI Templates
Hi:
In one step in my setup program I'm asking user to supply database
connection information using supplied UI Templates. How can I prevent user
from moving forward if fields are left empty?
Thanks,
Charlie Tag: Executable's path Tag: 112747
Running MS Word in VB.net with a switch
Hello,
We are currently running Word in a form OK. However, we need to run a
dedicated instance. In order to run this instance, as a service we use
the following code:
Dim p As New ProcessStartInfo("winword.exe", "/x")
Process.GetCurrentProcess().StartInfo = p
Currently to execute word in vb.net so that we can get a handle on it,
we use:
dim wrdapp as New Word.Application.
Is there a way to have wrdapp run the application with the /x switch
as we need to get a handle on the application to open documents within
this.
Thanks in Advance,
Dean Tag: Executable's path Tag: 112745
Clicking on a label's border does not work
Hey guys,
I've been trying to figure this out for a while now. I have a form with
some labels. The labels' click events are handled fine if I click inside the
label but if I position the mouse directly on the border of the label (a
fixed single border) the click isn't registered.
Is it just impossible to click/double click the label's border and set off
the click event handler? If anyone knows how this can be done, please let me
know.
Thanks. Tag: Executable's path Tag: 112742
Was form miximized while closing?
I want to store state of the form such as X and Y position, size, height of
GridView on this form when form is closed. Then on load I want to reload this
state.
The question is how do I know if form was in maximized state while closing
and would appreciate if you could point me to example of doing above task.
--
Thanks,
Mahesh Tag: Executable's path Tag: 112739
FolderBrowserDialog.RootFolder not using special folder?
Is it possible to set the root folder of FolderBrowsserDialog to any
folder I want. ie c:\temp or something?
Haven't yet found a way to do this.
Thanks for any responses. Tag: Executable's path Tag: 112737
Check data before binding manager add to table
Hello,
How can I check for Null or other constraint before the row will be added by
the binding manager to the datatable.
sorry for my english i'm from Italy
Grazie
Stefano Bonazzi
--
Stefano Bonazzi Tag: Executable's path Tag: 112733
Idosynchrosies relating to the taskbar
A couple of issues for the boffins among you.
Given a screen with the taskbar docked at the bottom and a maximized form
with a statusbar docked at the bottom where the ShowItemToolTips property is
set to True, when one moves the mouse over any of the items on the statusbar
that have a ToolTip and the ToolTip is painted so that it overlaps the
taskbar then the ToolTip blinks at a fairly fast frequency. On XP this
behaviour occurs along the whole length of the taskbar however on Vista this
behaviour occurs only when the ToolTip overlaps the system tray area.
To me it appears that on XP, the whole taskbar is being repainted several
times per second and that on Vista, the system tray area is being repainted
several times per second, thus causing an overlapping window (the ToolTip in
this case) to be repainted as well.
Again, given a screen with the taskbar docked at the bottom and set to 'Keep
on top of other windows', on XP, when one resizes a window by dragging the
bottom border, one cannot drag the border any lower than the top of the
taskbar, however, on Vista, when one does the eqivalent operation one can
drag the bottom border lower than the top of the taskbar with the result
that the lower portion of the window ends up behind the taskbar.
This one is probably a bit more subtle in that it would appear that when a
window is being resized by dragging a border, Vista is using an equivalent
of Screen.Bounds to limit the drag operation rather than an equivalent of
Screen.WorkingArea.
Needless to say, both observed behaviours are quite disconcerting.
Has anyone else noticed either of these behaviours and perhaps come up with
a workaround? Tag: Executable's path Tag: 112732
HTTPWebRequest, Proxy, Credentials?
Is there a simple way to get my logon credentials to make my web request
work through our proxy server? I tried CredentialCache.DefaultCredentials,
but I get nothing back. I can get it to work if I just create a new
NetworkCredential object specifying user, password and domain. But, I would
rather get that info automatically if possible, rather than presenting a
winform for them to type it in.
Lastly, why do both the request object and the request's proxy object have
properties for credentials? Do I need to populate them both?
Thanks,
// WebRequest
HttpWebRequest webRequest =
(HttpWebRequest)WebRequest.Create(anyURL);
webRequest.Timeout = 10000;
webRequest.CookieContainer = cookieContainer;
// Proxy Credentials?
webRequest.Proxy = WebProxy.GetDefaultProxy();
webRequest.Proxy.Credentials = new
NetworkCredential("XXX","YYY","ZZZ");
webRequest.Credentials = CredentialCache.DefaultCredentials;
webRequest.Credentials = new
NetworkCredential("XXX","YYY","ZZZ"); Tag: Executable's path Tag: 112731
Custom Toolstrip
I want to create a toolstrip and I would like to make that toolstrip reusable
by other windows in my application. This would be the same concept as a
UserControl, only it would be a Toolstrip. Any suggestions on the best way to
do that? Tag: Executable's path Tag: 112728
Unable to close Microsoft Word within AxWebBrowser Control
Hello,
I am currently opening Word in an AxWebBrowser Control on a form. When
the user saves the saves the document using a save + close button on
the form, it saves the document, navigates the AxWebBrowser Control to
about:blank and exits word and then closes the form.
The exiting of word and the closing of the form is run in the
AxWebBrowser.NavigateComplete event handler.
The issue I have, is if the user clicks the close button on the form,
it still leaves word running.
If I try to exit word in the form.closing or form.closed event
handler, it has an error as the word document is still displaying in
the AxWebBrowser Control. Because the form is closing, it cannot run
the AxWebBrowser.NavigateComplete event handler.
This then leaves multiple instances of Word open in the Process
tables.
Does anyone know if there is a way of closing word without any errors
when the user closes the form?
Many Thanks,
Dean Tag: Executable's path Tag: 112726
a problem in datagridview
i am using a DataGridView control to populate data from database.
it has a checkbox column for selecting and some other textbox columns
for showing the data.
the form also has a toolstrip which has a button for viewing print
preview of selected rows. when the user selects or deselects a row
then the preview button visiblity changes depending upon whether one
or more rows are checked.
i created the procedure for it as following:
--------------------------------------------------------------------------------------------------
Public Sub TogglePrintPreview()
Dim flagPreview As Boolean = False
For i As Integer = 0 To dgSwitchInv.Rows.Count - 1
If
Convert.ToBoolean(dgSwitchInv.Rows(i).Cells(0).EditedFormattedValue) =
True Then
flagPreview = True
End If
Next
ActiveDirectory.HideButton(Me.Name, btnPreview, flagPreview)
End Sub
--------------------------------------------------------------------------------------------------
but the preview button does not change its visiblity everytime
am i doing something wrong here. or is there a better solution for
this. Tag: Executable's path Tag: 112723
Continual restart, never loads
One of my computers is is in a continual restart, it never loads. The
windows logo appears with the animated bar under it, it will go one and a
half times them shuts down and starts back up. Safe mode does the same
thing. The recovery console gives me this error message:
UNMOUNTABLE_BOOT_VOLUME
Technical information:
*** STOP: 0x000000ED (0x862b0848,0xc0000006,0x00000000,0x00000000)
I have tried to use norton to scan it and fix it but says there is nothing
wrong.
Anyone who has any information would be very much appreciated. Thank You. Tag: Executable's path Tag: 112716
XP style GUI for winform
hi i m using .net 2003 and winform application, i m using below article to
make my application winform outlook like xp style, but it does not shows
controls on my winform as xp style , but it shows messagebox(using
MessageBx.Show("dd")) like xp style, what i m missing , how to make my
winform button also behave lik xp style.
http://msdn2.microsoft.com/en-us/library/aa289524(VS.71).aspx#vbtchusingwindowsxpvisualstyleswithcontrolsonwindowsformsanchor7
thanks in advance. Tag: Executable's path Tag: 112708
vs 2005, borken installation? No controls show up
I've installed vs 2005 pro and sp1. When I try to add controls to a
winform, they never appear on the canvas. The controls are listed at the
bottom of the design area, so apparently they are being added to the
form. But after adding buttons tabs whatever, the form is still blank
looking. Per property box all are visible with valid locations and
dimensions.
Something is very screwed up. Has this been heard of? How can the ide
fail at such basic tasks? Tag: Executable's path Tag: 112707
Waiting for a process to Finish (Threading)
Hello,
I have having issues with threading. Below is the code I am running:
'Prints the word doc
myWordApp.ActivePrinter = cboPrintList.SelectedItem
myWordApp.PrintOut()
'Sets the default printer back
myWordApp.ActivePrinter = strDefaultPrinter
'Pauses until the word document is printed
System.Threading.Thread.Sleep(2000)
'Closes the word document
myWordApp.Quit(False)
The issue is that the word document is still printing in word as the
Word Application closes, so the document never prints.
Is there a way to have quit word once the printing has finished by
using threads. I am quite new to threading, so I'm probably missing
something obvious (or not).
Many Thanks in Advance,
Dean Tag: Executable's path Tag: 112702
Errors Found Code 80244019 Windows Vista Business
Hi there,
Recently i've installed Windows Vista Business. When i run Windows update i
get the following error Code 80244019. I allready tried to set the LAN
settings to automaticly dectected settings, but that won't work. Earlier i
also removed a setting in my regedit but that didn't work alswell. The
settings for automatic updates is grey i can't put them on because i am no
administrator. I changed this settings to administrator but no succes. Is
there anabody who had the same problem with this error??
Tnx Michel Tag: Executable's path Tag: 112701
vs2005: windows form won't minimize or maximize
I have a main form window (c#) that won't minimize or maximize. Clicking the control menu buttons will minimize or maximize the form, but the form immediately reverts back to normal size. This just started all of a sudden, I have rebuilt the app, and searched through the form code and properties. Nothing was changed as far as I know, and there is nothing out of the ordinary I can find. I'm pretty far into designing this form and I'd like to keep it if I could rather than redesigning it since it has toolbars, tree and grid controls. Tag: Executable's path Tag: 112695
Winform controls vs. WPF controls.
Will Net 2.0 Winform controls work in WPF apps or does a control have to be
specifically designed for WPF?
Bill Tag: Executable's path Tag: 112694
Looking for suggestions on design patterns/architecture books
Hey guys,
I'm looking to improve my knowledge of design patterns and n-tiered
application architecture. Do any of you have any suggestions on good reading
material?
I know the GoF book on design patterns is very popular but I was wondering
if that is my best choice to learn these design patterns. It is a pretty old
book and in C+, and I am concentrating on C# but I don't think that would be
a problem. However, if anyone knows a book thats just as good as the GoF one
and in C#, please let me know.
Besides desing patterns, I would like to learn more about n-tiered
architecture and application development (winforms and soon WPF). Any
suggestions for this (C# preferred)?
Thanks for the input,
-Flack Tag: Executable's path Tag: 112693
Question on WPF
Is it possible to develop a windows app using WPF and net 3.0 that will run
in a browser or on the desktop without any changes to it?
Bill Tag: Executable's path Tag: 112692
Web based timesheet application
http://www.livetecs.com
TimeLive Web Collaboration Suite is an integrated suite that allows you to
manage project life cycle including tasks, issues, bugs, timesheet, expense,
attendance.
TimeLive is available in two different flavors. Hosted version and
downloadable version. Downloadable version required certain system
requirement to install on local server. Whereas hosted version is already
installed on our fully managed server on state of art datacenter.
Free Lite version is available in both hosted and installable version.
Here are some key features of "TimeLive":
TimeSheet·
-----------
· Track your contractor and employee's timesheet using full featured and
easy to use Time Entry tool. You can then use detailed and summarized view
of all time records using different tools.
· Time Entry Day View for entering full day timesheet in just one server
hit.
· Time Entry Week View for entering full week timesheet in just one server
hit.
· Organization setup like Departments, Locations, Roles
· Different type of Off day monitoring like Sick Days, Vacations etc.
· Client Setup
· Project Setup
· Task setup with multiple assignees for single task.
· Audit Trail
· EMail notification of different timesheet related activities to users.
· Different billing type setup like Hourly / Task based / Call based
· Timesheet approval
· Four Timesheet Approval Paths (None,Administrator,Project,TeamLead)
· Reports with all possible filter selection to get your required output.
· Detail Timesheet Report
· Different timesheet summary reports for based on Client, Project,
Employee, Date
· Timesheet Approval status report
· Reminders to employee for their pending entries.
Attendance
------------
· Web based Attendance system to record and monitor all employee attendance
using simple / fully featured tool.
· Time In
· Time Out
· Off Day reporting for different purpose like Sick leave, vacation etc
· Working Day setup
· Daily Attendance report
· Summary reports for employee off days to track employee Sick leave,
vacation etc.
· Detail report employee off days.
Bug Tracking
------------
· Full integrated bug tracking tool to monitor all bugs / issues using
simple and full featured tool.
· Bug can be add with fields
· Subject
· Description
· Project
· Milestone
· Parent Task
· Duration
· Due Date
· Priority
· Files to be attached
· Multiple assignee of single bug.
· Dashboard view of bug showing All open task / All Reported Task
· Project based open bug summary view
· Bug comments
· Audit trail of every bug modification
· Updating of Bug status
· EMail notification of bug addition and update.
· ReOpen bug tracking and monitoring.
· Quality control reports summarizing bugs by Project / Milestone / Assignee
/ Status
· Personalized overall summary view of projects for Project Manager and Team
Lead.
Expenses Tracking
------------------
· Manage and monitor your project expenses with easy to use integrated
TimeLive Expense management tools.
· Expense entry view for employee to enter their expenses occurred on
project.
· Billable / Unbillable expenses.
· Detail Reports for monitoring expenses
· Different summarize report by Project / Employee / Expenses.
· Approval of Expenses with 4 different approval paths.
· No Approval
· Team Lead
· Team Lead --> Project Manager
· Team Lead --> Project Manager --> Administrator.
· Expenses approval monitoring.
Project Monitoring
---------------------
· Full featured tool to manage your projects and their task with single
integrated tool.
· Nested Task with task hierarchy.
· Tracking of project status
· Assigning of projects to multiple employee
· Tracking of project tasks
· Different dashboard view for Project Manager, Team Lead and Team Member.
· Different report to track and monitor overall project status.
Other Features
----------------
· Exportable reports in PDF and XLS file.
· Downloadable / Hosted version
· Free basic version
· Unlimited disk space for all plans
. International date formats supported. Tag: Executable's path Tag: 112689
Uninstalling SmartClient on XP
I installed a .Net 2.0 SmartClient on an XP machine. The options for the
SmartClient install was that the 'Application is only available online'. How
do I remove it? How do I view a list of installed SmartClients and their
versions?
Thanks for your help!
Terry Tag: Executable's path Tag: 112687
Context menu depending on panel
I have a form that has 3 different panels in it. I want to have a different
context menu depending on which panel the mouse cursor is in at the time of
the right click on the mouse. How do I achieve this?
Bill Tag: Executable's path Tag: 112684
memory not being released
Hello all,
I have a winforms app running on framework v2.0.50727 which isn't not
releasing memory back to the OS after closing forms. Simple forms (a list +
button)
or complex ones (tabs, lots of text boxes, third party masked edit control)
behave the same way,
Every time is instantiated it allocates memory which never gets released.
The code sequence is
Dim frCustomer As New frmCustomer
..
custom code to populate form
...
frCustomer.ShowDialog()
frCustomer.Dispose()
If Not frCustomerIs Nothing Then frCustomer= Nothing
Where should I start troubleshooting? What am I doing wrong.
Thanks a million,
Gigel Tag: Executable's path Tag: 112683
Difficult issue with ITypedList and subclasses
I am employing ITypedList to expose properties of contained classes and am
having trouble with properties nested a few levels down. My class structure
looks something like this:
EmployeeCollection ' A collection of Employee objects,
Implements ITypedList
Employee ' Decorated with an attribute that
points to a CustomTypeDescriptor. This CustomTypeDescriptor class exposes
properties of an Activity class that is contained in Employee.
Activity ' A Simple class, also decorated
with an attribute that points to a CustomTypeDescriptor-derived class. This
class exposes properties of the Attribute class, contained by Activity.
Attribute 'A simple class contained by Activity.
I bind a DataGridView to the EmployeeCollection class. I've been successful
in using ITypedList when going one level deep, but when I cannot seem to
expose the properties of the Attribute class at the highest level. In other
words, I want to display properties of Employee, Activity, and Attribute in
the datagridview, but cannot see below the Activity class's properties.
Any insights would be appreciated.
P.S. Sorry if this message posts several times. Not sure why this happens. Tag: Executable's path Tag: 112682
RDP ActiveX control in winform
i'm writing a simple c# program to start an RDP session from a windows form.
everything works fine except i can not determine how to cause the program to
allow me to execute a specific application on connection:
try
{
rdpSession.Server = myServer;
rdpSession.UserName = myUserName;
rdpSession.AdvancedSettings2.ClearTextPassword =
"************";
rdpSession.Domain = "myDomain";
rdpSession.AdvancedSettings2.ConnectToServerConsole = true;
if (rdpSession.SecuredSettingsEnabled >= 0 )
{
rdpSession.SecuredSettings.StartProgram =
"c:\\Windows\\notepad.exe";
rdpSession.SecuredSettings.WorkDir = "c:\\temp";
}
else
{
MessageBox.Show("Can't access the secured setting
(startprogram)");
}
rdpSession.Connect();
}
my understanding from the documentation of the control is that:
These restricted properties are accessed using the IMsTscSecuredSettings
interface and the IMsRdpClientSecuredSettings interface, and are available in
the following Internet Explorer URL security zones:
My Computer
Local Intranet
Trusted Sites
They are disabled in these zones:
Internet
Restricted Sites
when i examine the value at SecuredSettingsEnabled in the debugger it is
always -1 and therefore skips executing the startup application.
[it does start a desktop session in which i can execute the application -
which seems to circumvent the intended "security feature"??? - but perhaps i
am thinking wrongly???]
is there a way to cause the application to evaluate what Internet Explorer
URL security zones it is running in - the concept seems inappropriate and
inapplicable to running my executable? but again perhaps i am not thinking
correctly?
TIA Tag: Executable's path Tag: 112677
Do I need to call base.WndProc in this scenario?
Hi all,
I have been working around the notorious 'Automatically scroll
selected control into view' 'feature' of the .net framework using the
following code. Now I read that if I do not call base.WndProc, this
can cause problems like 'Error creating Window Handle' and I am
getting this error.
My code is as below. How do I modify it to prevent the WM_SETFOCUS
from being handled but still call base.WndProc()? Thanks!
private const int WM_SETFOCUS = 0x0007;
protected override void WndProc(ref Message m)
{
// Listen for operating system messages.
// The WM_SETFOCUS message is sent to a window after it
has gained the keyboard focus.
if (m.Msg != WM_SETFOCUS)
{
base.WndProc(ref m);
}
} Tag: Executable's path Tag: 112676
Active application
Hello,
I have 2 applications.
A menu command in the first communicates to the second by ipc remoting.
When the second application has finished the remoted operation, it must
activate itself.
I tried lot of things... For example, with SetForegroundWindow, the
second application's icon flashes in the task bar but it is not activated.
Have you any idea ?
Thanks.
Jean Tag: Executable's path Tag: 112673
Multiple AddHandler for multiple Controls on a form
Hello all,
We have a bit of a problem. We have a form where we have to add controls
dynamically during runtime. That part is quite simple. Now, we have to add a
ButtonClick event for each of the controls. That's where it becoms tricky.
Here is the bit of code we use:
-------------------------------------------------------------------------------------
TextControl = New Asd.ControlLibrary.AsdTextControl
Me.TextControl.BackColor = System.Drawing.Color.Transparent
....additional properties setup
If CheckStoredProcedure <> "" Then
Me.TextControl.CheckStoredProcedure = CheckStoredProcedure
Me.TextControl.ButtonBook = True
Me.TextControl.ErrrorProvider = True
Me.TextControl.CheckRequired = True
End If
AddHandler TextControl.ButtonBookClick, AddressOf TextControl_ButtonBook
Me.Controls.Add(TextControl)
--------------------------------------------------------------------------------------
Now, everything works fine and each control acts as a separate control, but
the TextControl_ButtonBook fires only for the very last created control. I
have tried adding 'sender' parameter to the procedure but the addressof
won't accept it.
Any help and/or insight is much appreciated.
Thanks in advance.
GAZ Tag: Executable's path Tag: 112672
Programmatically changing the size of a textbox
I have a textbox that is multiline but I only want to show one line at the
start until that line is filled in. I am going to use the textchanged event
to check the length of the text in the field. If the length of the text is
greater than the length of the field, I am going to change the height of the
textbox to show another line and when that is filled I am going to add a new
line etc etc. My question is what is the easiest way to move all the
controls below this textbox down?
Bill Tag: Executable's path Tag: 112665
Help. Problem with MaskedTextBox in DataGridView control
Hi,
I am adding a MaskedTextBox control to a datagridcontrol. So far, I
can see the masked value, but when I start the application up, the
maskedtextbox cell is blank. When I select it, I can see the masked
value "00000-000-00000-0". I change the value and click a readonly
cell. The maskedtextbox values goes blank. When I click on the cell
again, the value reappears on selection event. However, When I click
on a non readonly cell, the maskedtextbox value totally disappear.
At startup, the masked value 00000-000-00000-0 is invisible until I
select the value. Here is my code. Any help is greatly appreciated.
public class MaskedTextBoxCell : DataGridViewTextBoxCell
{
public MaskedTextBoxCell()
: base()
{
}
public override void InitializeEditingControl(int rowIndex,
object
initialFormattedValue, DataGridViewCellStyle
dataGridViewCellStyle)
{
try
{
// Set the value of the editing control to the current
cell value.
base.InitializeEditingControl(rowIndex,
initialFormattedValue,
dataGridViewCellStyle);
MaskedTextBoxEditingControl ctl =
DataGridView.EditingControl as
MaskedTextBoxEditingControl;
ctl.Mask = "00000-000-00000-0";
//ctl.Value = (DateTime)this.Value;
}
catch (System.ArgumentOutOfRangeException)
{
// do nothing
}
}
public override Type EditType
{
get
{
// Return the type of the editing contol that
CalendarCell uses.
return typeof(MaskedTextBoxEditingControl);
}
}
public override Type ValueType
{
get
{
return typeof(MaskedTextBox);
// Return the type of the value that CalendarCell
contains.
// return typeof(DateTime);
}
}
public override object DefaultNewRowValue
{
get
{
return "00000-000-00000-0";
}
}
}
public class MaskedTextBoxColumn : DataGridViewColumn
{
public MaskedTextBoxColumn()
: base(new MaskedTextBoxCell())
{
}
public override DataGridViewCell CellTemplate
{
get
{
return base.CellTemplate;
}
set
{
// Ensure that the cell used for the template is a
CalendarCell.
if (value != null &&
!
value.GetType().IsAssignableFrom(typeof(MaskedTextBoxCell)))
{
throw new InvalidCastException("Must be a
MaskedTextBoxCell");
}
base.CellTemplate = value;
}
}
}
class MaskedTextBoxEditingControl : MaskedTextBox,
IDataGridViewEditingControl
{
DataGridView dataGridView;
private bool valueChanged = false;
int rowIndex;
public MaskedTextBoxEditingControl()
{
this.Mask = "00000-000-00000-0";
}
public string MaskFormat
{
set
{
this.Mask = "00000-000-00000-0";
}
}
// Implements the
IDataGridViewEditingControl.EditingControlFormattedValue
// property.
public object EditingControlFormattedValue
{
get
{
return this.Text;
}
set
{
if (value is String)
{
this.Text = (string)value;
}
}
}
// Implements the
// IDataGridViewEditingControl.GetEditingControlFormattedValue
method.
public object GetEditingControlFormattedValue(
DataGridViewDataErrorContexts context)
{
return EditingControlFormattedValue;
}
// Implements the
// IDataGridViewEditingControl.ApplyCellStyleToEditingControl
method.
public void ApplyCellStyleToEditingControl(
DataGridViewCellStyle dataGridViewCellStyle)
{
this.Font = dataGridViewCellStyle.Font;
//this.CalendarForeColor =
dataGridViewCellStyle.ForeColor;
//this.CalendarMonthBackground =
dataGridViewCellStyle.BackColor;
}
// Implements the
IDataGridViewEditingControl.EditingControlRowIndex
// property.
public int EditingControlRowIndex
{
get
{
return rowIndex;
}
set
{
rowIndex = value;
}
}
// Implements the
IDataGridViewEditingControl.EditingControlWantsInputKey
// method.
public bool EditingControlWantsInputKey(
Keys key, bool dataGridViewWantsInputKey)
{
// Let the DateTimePicker handle the keys listed.
switch (key & Keys.KeyCode)
{
case Keys.Left:
case Keys.Up:
case Keys.Down:
case Keys.Right:
case Keys.Home:
case Keys.End:
case Keys.PageDown:
case Keys.PageUp:
return true;
default:
return false;
}
}
// Implements the
IDataGridViewEditingControl.PrepareEditingControlForEdit
// method.
public void PrepareEditingControlForEdit(bool selectAll)
{
// No preparation needs to be done.
}
// Implements the IDataGridViewEditingControl
// .RepositionEditingControlOnValueChange property.
public bool RepositionEditingControlOnValueChange
{
get
{
return false;
}
}
// Implements the IDataGridViewEditingControl
// .EditingControlDataGridView property.
public DataGridView EditingControlDataGridView
{
get
{
return dataGridView;
}
set
{
dataGridView = value;
}
}
// Implements the IDataGridViewEditingControl
// .EditingControlValueChanged property.
public bool EditingControlValueChanged
{
get
{
return valueChanged;
}
set
{
valueChanged = value;
}
}
// Implements the IDataGridViewEditingControl
// .EditingPanelCursor property.
public Cursor EditingPanelCursor
{
get
{
return base.Cursor;
}
}
//protected override void OnValueChanged(EventArgs eventargs)
protected void OnValueChanged(EventArgs eventargs)
{
// Notify the DataGridView that the contents of the cell
// have changed.
valueChanged = true;
this.EditingControlDataGridView.NotifyCurrentCellDirty(true);
//base.OnValueChanged(eventargs);
}
} Tag: Executable's path Tag: 112661
Windows - Application error
Every time I boot up my Vista machine I get the error message:-
the instruction at 0x00366f9d referenced memory at 0x00000f18. the memory
could not be read.
Does anyone know what the problem is? Tag: Executable's path Tag: 112660
Adding addition accelerators
I want to support the CUA editing keys (Shift+Del, Ctrl+Ins, Shift+Ins) and
I'd like to do it more elegantly than with the KeyDown event. Is there any
way to add multiple accelerators to a menu item? Unfortunately, the
Shortcut/ShortcutKeys properties do not take arrays. Can something be done
pre- or post-compile, like maybe messing with the manifest somehow? Tag: Executable's path Tag: 112659
DataGridView ComboBoxColumn
I am trying to use the DataGridView to accomplish a certain task.
Here is my scenario:
I have a datasource that has a Model/Make relationship. It can be likened
to a user filling in what cars they own. So they add a new row and select
the Mae of their car from a combobox. Then they can select the model from
another combobox in the same grid. The model combobox only contains possible
models for the make selected. In turn, if they go back to that row later and
select a different make, the model choices should now correspond to the newly
selected make.
Everything else on my winform is bound so, for consistency sake, I am trying
to keep all this databound too.
Any ideas, sample code, etc???
For what it is worth, I am aware that one can create a custom datagridview
combox column. I have looked at this briefly and it is hard for me to
determine what events I would need to override in order to get my desired
functionality.
Any ideas?
Thanks in advanced! Tag: Executable's path Tag: 112655
App.config - Break up into multiple files?
Hi,
I have a legacy application which I can't change which has a _huge_
app.config file. I want to break it up into several smaller files and
use !ENTITY to include them into the main app.config file;
<!ENTITY foo SYSTEM="../../foo.config">
<foo>
&foo;
</foo>
Suffice to say, this doesn't work. I get 'reference to undeclared
entity 'foo' line 2 position 6'. It looks like the section handler is
reading <foo> as a totally seperate XML document ('line 2' is the
giveaway), which of course, doesn't have the <!ENTITY> bit.
Does anyone know if it's possible to break up app.config into seperate
files and include them like this (or any other way!)? It would seem
not.
Many thanks
Paul. Tag: Executable's path Tag: 112654
Ignoring all key events in whole application
Hi all,
I've been struggling with this problem for quite a while, and have searched
the internet many times, and tried many of the ideas which that turned up -
but haven't managed to get this to work!
Basically, my application receives serial messages from another system. If a
certain field is set to true in the status message then the application must
not let the user do anything using the keyboard. As in the application must
ignore all key events in all possible ways - none of the code in any KeyUp,
KeyDown or KeyPress events should execute, and all controls should ignore
keys (ie. if the focus is on a text box, then the text box must not allow the
user to add any text, and the same for any other controls). When the field is
changes back to false then the application should return to normal.
Basically, what I am looking for is a way to stop the application getting
any key events whatsoever. Is this possible? If so, what is the best (or
only?) way to do it?
I have struggled with such things as e->SupressKeyPress (which didn't seem
to work at all), PreFilterMessage, PreProcessMessage and haven't managed to
get anything to work!
If anyone has any ideas at all, I would be very grateful to hear them!
Cheers,
Robin Tag: Executable's path Tag: 112653
How to assign foreground color to TreeView in MPF
Hi folks,
Frist I am not sure this is the place to post MPF question. If not ,
please advise th url.
My question here is to assign foreground color to a TreeView conrol
in MPF . Please advise. thanks.
PeterK Tag: Executable's path Tag: 112649
Set focus to a Desktop's child
I have created a command prompt window (ruinning cmd.exe with the Process
class) and made it child of Desktop (or i attached it) using the APIs
FindWindow and SetParent, this way:
SetParent (MyCmdProcess.MainWindowHandle, FindWindow("ProgMan", null));
This works fine! Now, I want to create a little app to, when it is executed,
it shows the desktop (i already do this) and SET THE FOCUS TO THE CHILD
COMMAND PROMPT WINDOW (that is not a normal form). How can I do this?
Notes:
1) FindWindow (null, "PID_Terminal") returns null, maybe because it is a
child now.
2) After I turn the command prompt a desktop's child,
MyCmdProcess.MainWindowTitle is set to a empty string (""). Tag: Executable's path Tag: 112646
Same application in dual monitor
Actually the thing is i am devoloping a windows application, which will be
displayed in multiple monitors.
i have one single exe, which will be displayed in 2 monitors for example. In
cloning mode (windows display setting) both the screen will display the same
content. (eg. form1 will be displayed in screen1 and screen 2, since both
are same, check box click on screen 1 will show check box click on screen2).
Now in my case i want to show 2 different forms of same exe in screen1 and
screen 2. (eg. form1 in screen1 and form4 in screen2).
(1) first how do i do that? or is there any alternative ways?
(2) If i click a check box on form1(screen1), although the screen2 display
form4 , the check box on form1 in screen 2 should be checked.
how do i achieve this functionality.
There are actually 2 touch panels connected to the system. And both the
touch panels are interactive and shows the same(one main part of the
application). In the application for example there are 2 forms in which
through one form it controls temperature of the room and through other form
it controls room light.
But since this is one exe at a time only one operation will happen.(for eg.
if an operation in form1 hangs the system(screen1), system will be hanged in
screen2 too even it doent show form1)
In extended display, can we show same application, interactive in both the
screens? in which the screen can show same form or different form?
right now i am thinking to create 2 objects on form1 at runtime and attach
to the screen boundaries. but how we communicate an event in one object to
another object? Tag: Executable's path Tag: 112645
Need advice on Textbox control
In MS Outlook when entering an email address into the To box, when the
textbox is full, it expands to a multiline textbox and pushes everything
else down on the form. Are they using an ordinary textbox control and just
changing it to multiline?
Bill Tag: Executable's path Tag: 112644
Help. My datagridview columns are being reordered after binding to a dataobject
I made two datagridview controls and added the columns manually with
the wizard. I even specified the displayindex value for each columns.
Before binding to a dataobject, the columns are in the order which I
specified. After binding the datagrid.datasource to the object LIST,
the order of the columns are reorder. Beside specifying the
displayINDEX value, I don't know what to do.
Any help is greatly appreciated.
thanks, Tag: Executable's path Tag: 112643
Help. My datagridview columns are being reordered after binding to data object
I have a datagridview which I used the wizard to manually add the
columns. I even manually typed in the displayed index value for each
columns. Before binding to a data object, which contains a LIST, the
order of the columns are as I specified in the wizard. However, when I
binded the grid.datasource to the object.LIST and specified the
DataPropertyName, the columns got reordered.
I can not figure out why it is doing this. Any help is greatly
appreciated. By the way, I have no control on the data object. I have
to accept it as it is.
Beside specifying the displayIndex, I don't know what else to do
beside pulling my hair.
Thanks for any help / insight. Tag: Executable's path Tag: 112642
With .net2, how do I get the path of where the .EXE is located for a WinForms
app? e.g. for "h:\myapps\testapp\test.exe" , "h:\myapps\testapp\" should
bee returned