Key Handling Problem
I have written an MDI windows application that handles key presses to
do things like make text bold, and in a previous version successfully
used cut, copy and paste with a RichTextBox. However, at some point in
time, just the Cut, Copy and Paste stopped working. I was trying to
set it up so I could implement the same operations in the datagrid
that is also on my child form page. Originally I thought I had just
failed to correctly implement key handling for a Datagrid but as it
turned out, my rich text box also no can not process cut, copy and
paste.
After trying some things, I've learned:
Cntrl-A works in my datagrid and my text box just fine. But I think in
the Datagrid it uses default behavior.
Cntrl-B, I and U work in my textbox using my key handler event
routines.
Cntrl-C, X and V do not work at all now.
I'm using a boolean in my child form class to print Cntrl-I from
acting like a tab, but also allow normal tab to work. So that too
effects my handlers.
I also have small helper methods that actually implement the bold,
ital, underline and the copying, cutting, pasting. I've verified
through debugging that the code path never even gets to the copy/cut/
paste methods..
My key handling code:
internal void Entry_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control)
{
notes.HandleControlCodes(e, this);
TabEnabled = false;
}
}
private void Entry_KeyUp(object sender, KeyEventArgs e)
{
if (e.Control)
TabEnabled = true;
}
// Tab, Cntrl-I workaround
private void richTextBox1_KeyPress(object sender,
KeyPressEventArgs e)
{
if (TabEnabled)
return;
if (e.KeyChar == ((char)9))
e.Handled = true;
}
// In my notes class (which handles the richtextbox)
public void HandleControlCodes(KeyEventArgs e, Entry en)
{
if (e.KeyCode == Keys.A)
box.SelectAll();
else if (e.KeyCode == Keys.C)
box.Copy();
else if (e.KeyCode == Keys.X)
box.Cut();
else if (e.KeyCode == Keys.V)
box.Paste();
else if (e.KeyCode == Keys.B || e.KeyCode == Keys.I ||
e.KeyCode == Keys.U)
UpdateFontStyle(e.KeyCode == Keys.B, e.KeyCode ==
Keys.I, e.KeyCode == Keys.U);
else if (e.KeyCode == Keys.S)
en.saveToolStripMenuItem_Click(null, null);
}
I could use any insight, as I've tried to walk through and debug this,
but it is hard since I need to test the debugging response to Cntr-C,
X,V but I can't hold control down while tracing through the first
handling pass that occurs when I press just control. So I have only
been able to set a checkpoint on points like box.Copy that never got
reached. Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117164
datagridviewCombobox Problem
Add the following code under the dataError method:
Private Sub grdProcess_DataError(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewDataErrorEventArgs) Handles grdProcess.DataError
If e.Exception IsNot Nothing AndAlso _
e.Context = DataGridViewDataErrorContexts.Commit Then
MessageBox.Show("Office_rec_ref value must be unique.")
End If
End Sub Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117162
shdocvw webbrowser issue
Hello,
I add reference to shdocvw.dll and MSHTML.dll from VS 2005 winforms
solution to add activex webbrowser control.
I am not using managed web browser control.
All works well and i can get to see web pages navigating from this control.
When i create a setup and deploy project and distribute the winforms
application to another user using same IE version, i dont get to see the
web browser control on users' winform form.
Can someone help me create deploy project for shdocvw based winform
application.
I have not included shdocvw.dll in deployment project - just used the
interop assemblies.
i am using IE 6.0.3790 and the PC where i deploy also has the exact
version and build(not given here)
Will this winform application with activex browser run without problems
for IE 6.0 and above versions?
Thanks in advance
NZ Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117159
Suspending screen updates
Hi
I have a winform with a panel on it. I am doing visual changes to the panel.
Is there a way to suspend screen painting during these changes? If the whole
form needs its display suspended then that would work for me too. How can I
do this?
Thanks
Regards Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117149
Splash screen duration
Hi
I have a typical vs 2008 winfrom app with a start-up form and a splash
screen managed by the framework. My question is what makes the splash screen
disappear as I want to keep it displayed for a few more moments than it
does?
Thanks
Regards Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117147
Speed issue loading image
Hi
I am using below statement to load an image;
Me.MyPictureBox.Image = Image.FromFile(CStr(Me.txtMyPhotoPath.Value))
Problem is it is taking too long and slowing the app down. Is there another
faster way to achieve this? or to degrade the quality of image on the fly to
have to load smaller version of image for example?
Thanks
Regards Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117143
WinForm app speed issue
Hi
I have a multi-form winform database application. The client keeps
complaining that application runs too slow 50% of the time. The problem
seems to be in two areas;
a) app is slow maximising after a prolonged period of being minimised.
b) when user clicks on a toolbar to select one of the several already open
forms.
This seems to suggest that there is nothing wrong with application per se as
application works fine 50% and also maximising app or moving from one open
form to another open form does not do anything special code wise. Also as
other non .net apps run just fine on the same pcs, this can't be due to spec
of pcs. I have also ngen'd the app using command line 'ngen install
myapp.exe'.
I am therefore wondering what can be causing this slow response and would
appreciate any help in ironing out this speed issue.
Many Thanks
Regards Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117135
Visual Studio 2008 c# app to drag email to a form.. not quite work
I have this windows form app.. where i have a text box and from outlook i
want to be able to drag and drop from outlook to the form and basically copy
to this text box the subject and body text...
I thought i almost had this figured out.. here is the code near the end that
tries to "find" the outlook (2007) window and find the mail item data:
Microsoft.Office.Interop.Outlook.Application outlook;
//outlook = (Microsoft.VisualBasic.Interaction.GetObject("",
"Outlook.Application")) as Microsoft.Office.Interop.Outlook.Application;
try
{
//try to create comm component with vb interaction
outlook =
(Microsoft.Office.Interop.Outlook.Application)Microsoft.VisualBasic.Interaction.GetObject("", "Outlook.Application");
}
catch (System.Exception ex)
{
throw new ApplicationException("error" + ex);
}
//get the active one
Microsoft.Office.Interop.Outlook.Explorer explorer =
outlook.ActiveExplorer();
Microsoft.Office.Interop.Outlook.MailItem mail =
(Microsoft.Office.Interop.Outlook.MailItem)explorer.Selection[0];
//if (mail.Subject = maildata("Betreff").ToString())
//{
return mail;
It gets stuck on the line
outlook =
(Microsoft.Office.Interop.Outlook.Application)Microsoft.VisualBasic.Interaction.GetObject("", "Outlook.Application");
It will either sit there forever or if i actually put a break on the catch,
i am shown "cannot create activex component" as an error...
I'm not sure how else to go about this.. any thoughts?
Thanks Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117134
Anchor/dock problems
I'm using a DevExpress XtraGrid V. 7.3.5.0 and have posted on their forums as
well. I've built an application that has gone through testing, user training
and was deployed to production yesterday. On all the machines everything
worked as expected. However, there is one machine in the production
environment that doesn't quite work properly. Functionality is there, but
the grids don't anchor properly to fill the form. The form uses a
SplitContainer, docked to Fill, and the grids are on the panels. I'm not
using the Dock properties for the grids, I've set the Anchor properties. As
I said, it's only one machine. Thoughts? See attached image.
<a
href="http://s23.photobucket.com/albums/b378/DevonS76/junk/?action=view¤t=scr.jpg"
target="_blank"><img
src="http://i23.photobucket.com/albums/b378/DevonS76/junk/scr.jpg" border="0"
alt="Photobucket"></a> Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117133
Prevent a resx file from using the solution path as it's namespace?
I have many Views in my application and I've setup my solution structure
like so:
View
Data Entry
ViewA
ViewB
ViewC
Scanning
ViewD
ViewE
.. etc
Although I have created my folder structure like the above, I create all new
items in the root folder View, then I drag them into the correct folder.
This is to prevent Visual Studio from assigning the default Namespace of
<Root namespace>Views.DataEntry.ViewA
I don't want namespaces that granular, I just use the folders for visual
organization of my project.
Now, the problem I'm having is that I recently added a resx file for one of
my Views to store my strings and teh "designer.cs" file has the entire
project-folder-namespace. OK, so I edit the file and change the names space
from <Root namespace>Views.DataEntry.ViewA to <Root namespace>Views - no
luck, as soon as I edit the resource file and save it resets the namespace.
This is very, very, very annoying. Does anyone know of any tricks to deal
with such a scenario? I don't want to have my views all broken up in
logical folders that have a pile of resx file in the root of "View".
Any tricks very appreciated!
-Steve Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117126
Problem with the filtering of a property grid
Hello.
I created a designer in c#. Everything is working excepted the
property grid.
I want to show only the properties I added. So I created a class which
inherits of a button. And I added properties.
But I want to filter the base properties. So to do this, I inherit my
class from ICustomTypeDescriptor.
In the function getProperties, I filter. And I can show only my
properties. But on my host designer, the text of my button and the
position disappeared.
I mean when I add my custom button without filtering. I see it normal.
And if I filter, the text and position are removed. So it appears in
the left corner and I can't move it.
How can I fix the problem?
Thank you. Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117117
Design Patterns (Model View Presenter etc)
Hi
Im researching methods and design-patterns to separate UI's from logic and
model for the software Im developing at work (pretty generic UI's bound to a
datamodel etc). I have been working with dotnet for quite some time now
(~5yrs) but have never tried out any of these design patterns (MVC, MVP or
...) so its quite new to me.
If I separate the UI from the rest and make the UI know about "the rest" but
not the other way around. Is that a bad idea? To simple?
My view of the MVP-pattern is that it allows a sort of mediator (Presenter)
to maintain (get/set) the state of the View, listen to events delegated by
the view with void-no-params-metods and also do the appropriate modifications
to the model. Is that a correct view or have I missed the point?
How does these patterns exactly fit in the dotnet winform-model with
databindings etc? I can't use databindings with a MVP-pattern can I?
One other thing I'm struggling with is if I should loose winform and focus
on WPF instead. I have been looking on WPF for a couple of days but its seems
to be so much new... phew ... at the same time a want to learn ...
and then there are the (D)M-V-VM patterns for WPF ... and the MV-Poo pattern
I dont know what my question is here exactly ... guidance? enlightenment?
WinForm or WPF for ui-modularisation?, recommended design-pattern?, is there
any _simple_ example-projects for the different kinds of DP:s and the
differences between them, pros/cons over regular programming... ? Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117116
Best practices for GUI of what called in MFC custom controls
Hello All,
I have MFC-based application featuring:
1) Flow of "Screens" where screens are implemented as a MFC's
CDialog-inherited classes loading PNG or BMP images.
2) Dialog's child controls also loads PNG or BMP images.
What is the best practice to handle the same functionality in .NET/C#?
Thanks, Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117115
Tab Caption disappears, if I change the windows classic theme to
Hi all,
I have a dialog with a tab contorl with tab property "vertical" set to
true. Now if I change the theme from windows classic to windows xp
theme, the caption of the tab disappears. Is there any way to retain
the tabs caption in windows xp theme mode with tabs in vertical
alignment.
Thanx in advance Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117114
application.exe /Switch - how?
Howdy,
I'm a seasoned ASP.Net developer and I have a customer who needed a small
windows app that consumed a web services and dumped it into their Access DB.
I have the app done, and I must say it was easier than I thought, and now I'd
like to put the app on a scheduler using Windows Scheduler. How do I setup my
app to take a switch, like "application.exe /quiet /import true /log
c:\log.txt".
Thanks!!
--
David Lozzi
Delphi Technology Solutions
Blog: www.lozzi.net Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117112
Add-in Image question
In this line (connect.vb, after creating an add-in through the built in
VS.Net Add-in template),
Look at the '59' :
toolsMenuName = "Tools"
CommandObj = _applicationObject.Commands.AddNamedCommand(objAddin,
"My_Add-In", "My_Add-In", "Executes my stuff", True, 59, Nothing, 1 + 2)
CommandObj.AddControl(toolsMenuName)
That number adds the 'smiley face' icon for the Add-in entry in the Tools
menu, when the Add-in is used. If you change that, to another number,
another icon will appear.
Where can I find a list of the different icons that can be used here (what
numbers use what icon image)? Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117109
Domain Authentication
Hi All,
I'm struggling with this, I've googled it to death but can't find any
solution. So at the moment I'm thinking that what I want to do is not
possible.
It's pretty basic, I want to authenticate a user logging into a
windows application - against the domain. Seems like a simple enough
request, but hell...can't get any info on how to go about doing this!
I do not want to store user info in a database!
Can anyone help?
Thanks. Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117104
RTF content in contextmenu strip
I have a requirement- need to display RTF content in context menu. I
am able to host a rich textbox in a contextmenu strip using
ToolStripControlHost class. But assigning some RTF content to the
containing rich textbox control does not display in actual RTF
format- it just dislpays as plain text. Here's the code am using:
//Custom richtextbox to handle bg color in readonly mode
public class MyRichTextBox : RichTextBox
{
public MyRichTextBox()
{
}
public new bool ReadOnly
{
get
{
return base.ReadOnly;
}
set
{
if (value == true)
{
this.BackColor = Color.White;
}
base.ReadOnly = value;
}
}
}
----------------------------------------------------------------
public Form1()
{
InitializeComponent();
m_cmenu.Items.Add(new ToolStripMenuItem("Edit"));
m_cmenu.Items.Add(new ToolStripSeparator());
MyRichTextBox m_richTextBox = new MyRichTextBox();
m_richTextBox.BorderStyle =
System.Windows.Forms.BorderStyle.None;
m_richTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
m_richTextBox.ReadOnly = true;
m_richTextBox.ScrollBars =
System.Windows.Forms.RichTextBoxScrollBars.None;
ToolHost textItem = new ToolHost(m_richTextBox);
//Assign sample RTF content.
m_richTextBox.Rtf = @"{\rtf1\fbidis\ansi
\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fprq2\fcharset0
Arial;}{\f1\fnil\fcharset0 Microsoft Sans Serif;}}
\viewkind4\uc1\pard\ltrpar\sa200\sl276\slmult1\f0\fs28 This is\fs22
\i some\i0 \ul Rich\ulnone \b text\b0\par
\pard\ltrpar\f1\fs17\par }";
m_cmenu.Items.Add(textItem);
this.ContextMenuStrip = m_cmenu;//Assign contextmenu for
Form
} Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117103
Urgent help needed with ClickOnce Deployment
I have been using ClickOnce deployment with my app for over a week now and
everything was going fine. This weekend I changed my development machine
from windows vista to windows 2003 server. Now when I go to publish my app,
the checkbox "Sign the ClickOnce manifests" is checked. I don't want to
sign it. I didn't have to before. In fact I just looked at my laptop which
is running vista and I checked a copy of the code from a day ago and the
check box isn't checked. It has only happened since I moved the code to
Windows 2003 server. What can I do?
Bill Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117102
Keyboard Hooking including Unicode
I have been experimenting with sample code recommended by some folks on MSDN
for globally hooking the Keyboard in C#. The sample is by Michael Kennedy and
it's a System Hook class library.
Anyway, his class does the job of allowing me to receive Key-Down and Key-Up
events globally (as well as mouse stuff that I'm not really interested in
right now). But it doesn't give me what I really need.
What I'm really looking for is a C# class that will allow me to globally
handle events where I am passed the Keyboard "Text Input" as opposed to the
keyboard keys that are pressed. What I mean is that if the user had pressed a
lower-case "d" or an uppoer-case "D", I'd like to receive it that way... but
far more complicated than that, if they had pressed a key in a different
language kayboard, I'd like to receive that character in unicode. In other
words, I want to receive the TEXT character pressed or sent to the event
queue as opposed to receiving the hardware KEY pressed.
Any help - or especially code I could... "borrow"... would be *much*
appreciated!
Alex Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117098
DataSourceCredentials and ReportViewer
I am hard coding values for now just to get it working.
But here is my code.
reportViewer1.ServerReport.ReportServerUrl = new
Uri(@"http://MYDBSERVER/ReportServer/");
reportUrl = "/Events/GrievanceForm";
reportViewer1.ServerReport.ReportPath = reportUrl;
DataSourceCredentials credentials = new DataSourceCredentials();
credentials.Name = "?????????????????????????????????";
credentials.UserId = "username";
credentials.Password = "password";
reportViewer1.ServerReport.SetDataSourceCredentials(new
DataSourceCredentials[1] { credentials });
What do I put into credentials.Name???
Bill Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117094
In desperate need of ADD-in help!
I've recreated my add-in multiple times - - and at some point along the way,
I get an error in the connect.vb file at this line:
Dim toolsControl As CommandBarControl =
menuBarCommandBar.Controls.Item(toolsMenuName)
The error is :
Error 2 'Controls' is not a member of MyAddin.CommandBar'. C:\My
Apps\MyAddin\MyAddin\Connect.vb 55 49 MyAddin
It happens when I rebuild after adding something as innocent as a new
resource/image or changing a line of code to one place or another (not in
the connect.vb file itself).
It could happen at any time. Usually, I can just recreate the project, step
by step and add in my form and it works - but, I can't get it to go away at
all.
I've searched on Google but can't find anything
Can anyone help with this problem? Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117091
Threading with forms
Hi
I am trying to create (not open) several forms in the background threads
using the code given below at the end.
1. Am I doing it correctly?
2. How can I get handle sot these forms in the calling sub so I can access
these forms after creation.
3. How do I know when threads have finished forms creation so I can show the
form if needed?
Thanks
Regards
Code
====
Private Sub Main()
Dim t1 As New Thread(AddressOf CreateForm)
t1.Start(GetType(Form1))
Dim t2 As New Thread(AddressOf CreateForm)
t2.Start(GetType(Form2))
Dim t3 As New Thread(AddressOf CreateForm)
t3.Start(GetType(Form3))
End Sub
Public Sub CreateForm(ByVal ft As Object)
Dim t As Type = TryCast(ft, Type)
If Not t Is Nothing Then
Using f As Form = TryCast(Activator.CreateInstance(t, False),
Form)
End Using
End If
End Sub Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117086
Override minimum form height?
Is there a way to Override minimum form height?
It seem to have a minimum height of 27?
Thanks,
Schneider Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117083
FileOpen Icon?
Hey All,
Does anyone know where / how to get the FileOpen icon file?
Thanks,
TC Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117081
Associated icon for files in Treeview
I've got a Treeview, in which I'm adding file names/paths
How can I add the System image associated with that file (dynamically), in
the Treeview? Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117077
ValidateChildren not envoking validation on controls with CausesValidation set to false
From my lengthy and painful debugging experiment it seems that
UserControl.ValidateChildren() will not envoke validation of child controls
where their CausesValidation property is false.
I have a rather complex hierarchy starting with a MS CAB SmartPart view
placed on an Infragistics UltraTabPageControl tab, which contains a group
box, a flow panel and finally some UltraComboEditors. When the
ValidateChildren method is run on the view (which inherits from
UserControl), it seems to validate only controls which themselves cause
validation. I implement Validating() event handlers accross the whole
hierarchy, set all CausesValidation to false except the bottom level of
combos where I play with various combinations to see the validation being
triggered.
This dependency seems so odd, because
1 - wasn't ValidateChildren ment exactly a mechanism independent on
(alternative to) auto validation controlled by CausesValidation property.
2 - CausesValidation is supposed to control behaviour of other controls, not
itself.
Am I right about my observation of this schizophrenic character of
CausesValidation, is it something particular to the Infragistics controls
library, or is something wrong in my test case?
Any comments appreciated.
Pavel Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117074
DataGridView, DataGridViewComboBoxColumn problems
Hi,
I've been looking at this for a while now and I have tried 4 or 5
different options and I can't quite get this to work.
Requirements
I have a DataGridView setup in virtual mode and I want a Combobox
column in DropDownCombo style (i.e so you can type a new value in that
doesn't exist in the dropdown).
If the user types something into the editable portion that doesn't
exist in the dropdown I need to perform a search that may find a
matching item that I want added to the dropdown, this value should
then be selected and pushed back to the datastore.
Ideally I'd like to implement an iTunes style fuzzy matching algo as
well (perhaps filter the contents of the dropdown but I'd like to get
the simple option working first
Problem
I'm hitting issues with the validation, I've tried several points to
hook into the chain of events but none seem early enough to prevent a
DataError being thrown because the value I entered isn't in the
dropdown
Any thoughts on the best way to approach this problem?
Thanks in advance for your thoughts
David Hayes Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117073
Missing Images while printing in vb.net
Hi Toall ,
I want to explain you clearly ,
I am having some panels having some controls
CheckBox,ComboBox,Datagridview,Hyperlink,label,Listbox,Picturebox,RadioButt=
=AD
on ,Textbox)
&(Oval,Line,Rectangle ). with .BorderStyle =3D
BorderStyle.FixedSingle . All these things are generating at runtime
using some buttons .
I am taking them in to bitmaps and then printing using ACROBAT
DISTILLER printer.
I am printing each Bitmap on a new page taking e.MarginBounds of
PrintPage event using e.Graphics.DrawImage () .
I took each control on a single panel. Then i take the
panel
into bitmap using control.drawtobitmap() .And then I print the
things .
Suppose if the panel is having Circle or line or ComboBox or Checkbox
or DataGridView or URL or ListBox or RadioButton ,it is showing the
borders .
Suppose if it is having picturebox or rectangle or Textbox missing
the
borders . or if the panel is not having controls then it is missing
the borders while printing .
It is showing the borders in printpreview everytime(I have to zoom
to look at these things ) but while printing ,sometimes, it is
printing with borders ,sometimes it is missing the borders.
If it is the last page to print it is missing last
3-4 lines (Missing the image part at bottom ). Suppose, i am having
2
bitmaps having the samesize and controls ,then in 1st page it is
printing with controls & borders exactly correct .But while coming to
last page, it is missing bottom 3-4 lines which makes the printing
incorrect .
So any help about this to make the printing correct exactly.
Thanks & Regards , Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117071
Inspiron Laptop
Not sure why I am not able to log on..all my attempts say"The user profile
Service service failed logon, user profile cannot be loaded"
I have all the software that came in a box of original purchace.
Help Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117066
Is Vista Ready for VS2K5
I'm about to get a new computer for VS2K5 development. Is it ok to get
Vista yet or should I stick with XP?
Thanks,
Ross Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117056
SendKeys.Send Problem
Hello
I'm using the SendKeys.Send method for an onscreen keyboard. This works
perfect except one problem:
If i configure windows to use an english keyboard the call
SendKeys.Send("{^}") results in a "^".
BUT when my computer is running with an german keyboard, the call
SendKeys.Send("{^}") results in a "&".
MSDN says: If your application is intended for international use with a
variety of keyboards, the use of Send could yield unpredictable results and
should be avoided.
Okay that sounds bad, the strange thing is that every other keystroke (or
text) is working fine, excepts the "^" character.
Berni Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117054
c# stop user changing tab on tab control stops events
All,
I am trying to stop users changing tab pages on a tab control if the
tab page has not been validated. This I can do by adding a tab
control selected index change event handler and a tab page validating
event handler.
http://www.syncfusion.com/FAQ/winforms/FAQ_c93c.aspx#q958q
However, once validation has failed, no other events are thrown by
controls on the same tab page until the tab page has lost and then
regained focus. I have attached sample code for a simple form.
Uncheck the test box, try to change to tab 2, and then try and click
the Tab Button. It does not fire. But it does if you click Form
button first.
Can anyone suggest a solution to this. I have kept the sample code as
simple as possible.
Thanks in advance - code below.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace TabSample
{
public class Form1 : Form
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
private TabControl tabControl1;
private TabPage tabPage1;
private Button btnTabButton;
private CheckBox cbName;
private TabPage tabPage2;
private Button btnFormButton;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should
be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.cbName = new System.Windows.Forms.CheckBox();
this.btnTabButton = new System.Windows.Forms.Button();
this.btnFormButton = new System.Windows.Forms.Button();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.SuspendLayout();
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Location = new System.Drawing.Point(41,
12);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(376, 249);
this.tabControl1.TabIndex = 0;
this.tabControl1.SelectedIndexChanged += new
System.EventHandler(this.tabControl1_SelectedIndexChanged);
//
// tabPage1
//
this.tabPage1.Controls.Add(this.btnTabButton);
this.tabPage1.Controls.Add(this.cbName);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new
System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(368, 223);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "tabPage1";
this.tabPage1.UseVisualStyleBackColor = true;
this.tabPage1.Validating += new
System.ComponentModel.CancelEventHandler(this.tabPage1_Validating);
//
// tabPage2
//
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new
System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(192, 74);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "tabPage2";
this.tabPage2.UseVisualStyleBackColor = true;
//
// cbName
//
this.cbName.AutoSize = true;
this.cbName.Checked = true;
this.cbName.CheckState =
System.Windows.Forms.CheckState.Checked;
this.cbName.Location = new System.Drawing.Point(40, 57);
this.cbName.Name = "cbName";
this.cbName.Size = new System.Drawing.Size(55, 17);
this.cbName.TabIndex = 0;
this.cbName.Text = "Valid?";
this.cbName.UseVisualStyleBackColor = true;
//
// btnTabButton
//
this.btnTabButton.Location = new System.Drawing.Point(121,
142);
this.btnTabButton.Name = "btnTabButton";
this.btnTabButton.Size = new System.Drawing.Size(75, 23);
this.btnTabButton.TabIndex = 1;
this.btnTabButton.Text = "Tab Button";
this.btnTabButton.UseVisualStyleBackColor = true;
this.btnTabButton.Click += new
System.EventHandler(this.btnTabButton_Click);
//
// btnFormButton
//
this.btnFormButton.Location = new
System.Drawing.Point(166, 302);
this.btnFormButton.Name = "btnFormButton";
this.btnFormButton.Size = new System.Drawing.Size(75, 23);
this.btnFormButton.TabIndex = 1;
this.btnFormButton.Text = "Form Button";
this.btnFormButton.UseVisualStyleBackColor = true;
this.btnFormButton.Click += new
System.EventHandler(this.btnFormButton_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F,
13F);
this.AutoScaleMode =
System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(458, 348);
this.Controls.Add(this.btnFormButton);
this.Controls.Add(this.tabControl1);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// COnstructor
/// </summary>
public Form1()
{
InitializeComponent();
}
/// <summary>
/// Handle button on form
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnFormButton_Click(object sender, EventArgs e)
{
MessageBox.Show("Form Button Clicked");
}
/// <summary>
/// Handle button on tab page
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnTabButton_Click(object sender, EventArgs e)
{
MessageBox.Show("Tab Button Clicked");
}
/// <summary>
/// Tab control event handler
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void tabControl1_SelectedIndexChanged(object sender,
EventArgs e)
{
tabControl1.TabPages[tabControl1.SelectedIndex].Focus();
tabControl1.TabPages[tabControl1.SelectedIndex].CausesValidation =
true;
}
private void Form1_Load(object sender, EventArgs e)
{
tabControl1.TabPages[0].Focus();
tabControl1.TabPages[0].CausesValidation = true;
}
/// <summary>
/// Validate tab page
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void tabPage1_Validating(object sender,
CancelEventArgs e)
{
if (!this.cbName.Checked)
{
MessageBox.Show("Tab not valid - not leaving");
e.Cancel = true;
}
}
} // end of class
} // end of namespace Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117052
Automatic security Updates
I have "installed" the following updates from the Microsoft website, however
they do not appear in my add/remove program file on my pc., however appear to
have done so on the Microsoft site.
KB936181 and KB927978
I would like to know why these have not installed and how I can rectify the
problem.
I have to install update symbol showing all of the time, for the same update
and have attempted it around 10 times, each time being successful by
Microsoft but not really. Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117051
WPF
I use VS 2005
I would like to use WPF with VS 2005
Though I have download Visual Studio 2005 extensions for .NET Framework 3.0
(WCF & WPF), November 2006 CTP
and try to install it, it always say require .Net Framworks 3.0
I previously install .Net Frameworks 3.5 and can use Windows Workflow also
with install the extention for VS 2005.
Why can I do the same with WPF?
Regards,
Gun Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117049
How can I find out a person has logged in to the network in the office?
This is a multi-part message in MIME format.
------=_NextPart_000_0006_01C8AA0C.2346A160
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,
Do you know How I can find out a person has logged in to the network in =
the office?
Thanks,
Dennis
------=_NextPart_000_0006_01C8AA0C.2346A160
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.2900.2912" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>Hi,</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>Do you know <FONT size=3D1>How I can find out a =
person has=20
logged in to the network in the office?</FONT></FONT></DIV>
<DIV><FONT size=3D1></FONT> </DIV>
<DIV><FONT size=3D1>Thanks,</FONT></DIV>
<DIV><FONT size=3D1></FONT> </DIV>
<DIV><FONT size=3D1>Dennis</FONT></DIV></BODY></HTML>
------=_NextPart_000_0006_01C8AA0C.2346A160-- Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117045
Where is application installed to on machine?
I successfully deployed my app and it installed correctly on my test app.
So where is it? I can't find the files anywhere except an application
reference in the start menu directory. I need to see it because I want to
check the config file to make sure it's pointing to the correct directory.
I do a search for my config file and I can't find it. So what directory is
everything in?
BillG Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117042
Error when publishing
I am getting an error in my Installation Folder URL.
I type in my http://www.whatever.com/myApp/Deploy/
I get back
Cannot find
http://%%201%20http://www.whaterver.com/myApp/Deploy/publish.htm
make sure the pat or internet addriess is incorrect
Previous to this I have misspelled the name of the domain and it had built
the published setup.exe using the wrong domain name but now when I put in
the right one, it gives me an error
What gives?
Bill Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117040
WINDOWS DESKTOP SEARCH ISSUES
WDS is regularly reindexing my total HDD whether requested or not .
I would have thought it would have just looked back to when it did it last
and added on the new bit .
What it means is that when i want to search for things daily , which i do a
lot , that i cant find them as the whole indexing process is underway and
takes more than a little time to complete as my HDD has over 100,000 files !
I have de and reinstalled WDS a number of times but the problem just keeps
continuing .
I cant work out which WDS i have but believe it to be latest one . Please
tell me how to do this . I have run MS Update many times but there appears
none available .
I am using Windows XP Pro and have loads of ram .
thanks
Steve Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117037
Month Only DateTime Picker
Hi,
is it possible to use the DataTime Picker for month selection only? What's
the easiest approach for this?
Thanks for any hint
Adrian
--
Adrian Miller Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117036
Will data from a web service be cached in website?
This is a multi-part message in MIME format.
------=_NextPart_000_000C_01C8A917.65F86A20
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,
Will data from a web service be cached in website? Sometimes it sounds =
to me, but I am not sure about this. We are using HP notebooks and =
server.
Thanks,
Dennis
------=_NextPart_000_000C_01C8A917.65F86A20
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.2900.2912" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>Hi,</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>Will data from a web service be cached in website? =
Sometimes=20
it sounds to me, but I am not sure about this. We are using HP notebooks =
and=20
server.</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>Thanks,</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>Dennis</FONT></DIV></BODY></HTML>
------=_NextPart_000_000C_01C8A917.65F86A20-- Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117034
Winform to stay on top of a game window
I participate in a MMORPG using OpenGL. In conjunction with this, I
use a third-party application written in .NET 2.0 that collects data
from the MMORPG to help in analyzing my progress etc. I help a bit
with the development and maintenance of this window, and have
volunteered to TRY to figure out a solution to the following problem.
However I am kinda stuck.
This 3rd party app includes a form that stays on top of the game to
show various in-game data. This works fine under Windows XP, but when
using Vista, this "in-game window" does not redraw. Except if the game
is running in Windowed mode.
When running the game in full-screen under Vista, the in-game window
is not drawn. It IS on top, I can move the mouse over the area where
the window is, and the cursor will change. If I click it, it will
become active and visible. But once the game regains focus, the in-
game window is once again "invisible".
This must obviously have something to do with the way Vista handles
OpenGL, but what can be done to keep the in-game window visible when
running the game in full-screen?
The form has the TopMost property set to true, and as mentioned it
seems to BE on top, just "invisible". Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117033
ClickOnce Deployment Question
I published my first application on the customers website and they will
deploy using ClickOnce. All the files needed are on the server incluing the
net framework and 3rd party componenets. My question is when I do patches
and fixes, can I just copy my new .exe and .dll files and the manifest to
the server directory or do I have to copy all the files including 3rd party
components which haven't changed up there?
BillG Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117032
SP2 installation errors
Reloaded windows home edition SP1. Trying to update to SP2. I get errors
(unable to copy file dmio.sys). If I skip this file it stalls at unable to
copy input.dll. I can not find these files to download. Any help please Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117028
Visible Effect Lose at RunTime
Hi,
i had made a procedure with some object ( buttons , OptionBox, CheckBox)
using VB2005
When i write code and test it in VB2005 all componets get ligth when
mouse cross over...
I had build this code...in a dll...
where i call it (on the same pc) this "visible Effect" are lose
Anyone can tell me why ???
Thanks and sorry for y bad english
Daniele Pinai Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117027
Running command line commands with parameters read from a text fil
I am trying unsuccessfully to implement the following:
Run a command in command line (cmd.exe) while the command will use parameter
read from a text file.
The user will select the file to read in a winform and the same command will
run in a loop while using in each run the value in 1 single line in the text
file.
Can someone please advise what is the best way to do that?
Thanks a lot Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117025
Deleting rows from a datagridview
Hi,
If I delete 700 rows in an Excel sheet it takes about half a second, but
when I do the same with my databound datagridview, it takes up to 2 minutes.
Isn't there a faster way to delete selected rows in a datagridview?
My code:
For Each rw In Me.dgvImport.SelectedRows
rw.DataBoundItem.delete()
Next
rg,
Eric Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117021
deleting selected rows in a datagridview
Hi,
If I delete 700 rows in an Excel sheet it takes about half a second, but
when I do the same with my databound datagridview, it takes up to 2 minutes.
Isn't there a faster way to delete selected rows in a datagridview?
My code: Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117020
title bar
Hi group, I want to hide the titlebar of Form1, VS2005
thanks very much, Carlos. Tag: [.Net 2008] Client Host Name on Terminal Server Session Tag: 117014
How can I get the hostname (computer name) of a client that runs a .Net 2008
programme (from the client's side) on a Terminal Server Session ?