Prevent a combo box SelectedIndexChanged event firing multiple tim
I am working on a form where the user select a value from a combo box and
depending on his selection a popup window display, asking for more
information.
My problem is that this popup is displayed twice when the user makes the
selection. Another problem is that this combo box is on a multi tab page and
when the user selects the tab for the first time the combo is on, the popup
is also displayed twice.
How can I get the event to only fire once and only when the user selects an
item in the combo box?
Thanks in advance for your help,
Johannes Tag: picture preview controls Tag: 80171
Code Generation + WinForms Application facility
TierDeveloper at http://www.alachisoft.com not only generates code for
me but it also provide me with predesigned WinForms application where
i can test my work and most important of all I can customize those
forms and can use them with out wasting my time on building any other
interface.
--------------
JAnie Tag: picture preview controls Tag: 80168
WinForms application not appearing in taskbar until focused
Hi All,
I have a WinForms application (running under Framework 1.1) that loads
correctly, but if it isn't focused at load time, a corresponding button
doesn't appear in the taskbar.
When the application is given focus by clicking on it, or switching to
it via Alt-Tab, a button for the application appears in the taskbar.
This happens even with the ShowInTaskbar property of the form set to
true in code.
Has anyone come across this problem? I've searched Google and MSDN but
found nothing, yet this smells suspiciously like a Framework bug to me.
Yours,
Duncan Bayne Tag: picture preview controls Tag: 80159
Keyboard shortcuts
Hi All,
I have a form that contains many controls, including a custom control.
That custom control contains a number of child controls, including a
button with the text "&Search".
When the custom control or one of its child controls has focus, pressing
Alt-S causes the button to be clicked.
When one of the other controls on the form has focus, pressing Alt-S
does not cause the "&Search" button to be clicked.
Is this a WinForms issue, or am I misunderstanding something?
Yours,
Duncan Bayne Tag: picture preview controls Tag: 80157
How to disable a tab in tab control?
This is a multi-part message in MIME format.
------=_NextPart_000_0006_01C4C63C.9A017260
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Just cannot do it in tabpages. Do you know how to do it?
Thanks,
Dennis
------=_NextPart_000_0006_01C4C63C.9A017260
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.2180" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>Just cannot do it in tabpages. Do you know how to do =
it?</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_0006_01C4C63C.9A017260-- Tag: picture preview controls Tag: 80154
Printing Text With a Watermark
I have a production application that prints textual information, plus a
graphic watermark on each page. Currently it uses a PrintPageEventHandler
from the System.Drawing.Printing namespace to add the watermark and text to
each page.
The watermark is the same on each page, and is derived from a WMF file whose
size is about 120 KB.
The problem is that the spool files that are produced when we print are
somewhat large. The spool files without the watermark are only about 10 KB
per page. With the watermark (derived from a WMF file) the spool files are
about 300 KB per page.
What I would like to do is send the watermark only once per print job. This
would greatly decrease the load on the network and print server. How can I
accomplish this? Tag: picture preview controls Tag: 80150
The transport failed to connect to the server
I'm using VB.NET 2003 to writing a Windows application and I want it to send
email.
I've been assuming the easiest method is by using System.Web.Mail.SmtpMail.
I point a specific server using:
System.Web.Mail.SmtpMail.SmtpServer = "BANANA".
That server is our Exchange Server.
Everything works great for ME on my computer. However, when I give the .EXE
to someone else to run they're getting an error:
"System.Web.HttpException: Could not access 'CDO.Message' object. --->
System.Reflection.TargetInvocationException: Exception has been thrown by the
target of an invocation. ---> System.Runtime.InteropServices.COMException
(0x80040213): The transport failed to connect to the server."
My devbox has the SMTP service installed. The other guy's computer does
not. Is that why its failing on his computer? I'd hoped that if I point to
a specific server for delivery (rather than default to localhost) the SMTP
service wouldn't need to be installed on the host running my program. Tag: picture preview controls Tag: 80147
listbox shows blank items
Hi,
I have Windows 2000 SP4, Visual Studio 2003 (Microsoft Development
Environment 2003 / Version 7.1.3088), with Microsoft >NET Framework 1.1
(Version 1.1.4322 SP1).
Using C#, C++, or VB I create an application with
one form containing only a listbox, a textbox and a button.
The only code I type is for the button: when clicked
the code copies the text from the textbox to the listbox:
in C#:
private void button1_Click(object sender, System.EventArgs e) {
listBox1.Items.Add(textBox1.Text);
}
It appears the text is copied (I can select it), but
no text appear in the listbox.
When run the compiled program on a colleague's Windows XP
computer the result was the same!
Is this a framework issue (I hardly believe that!)?
Something on our computer's setup?
Any suggestion appreciated.
Many thanks Tag: picture preview controls Tag: 80145
ErrorProvider question
I'm binding an ErrorProvider object to a dataset by calling
ErrorProvider.BindToDataAndErrors() in a WinForms app. That seems to be
working fine.
The only issue I've found is that the error string displayed by an
ErrorProvider has the name of the column prepended to it. That could confuse
users.
The list of error strings for a given DataRow does not have the name
prepended. So it looks like a "feature" of the ErrorProvider class. Deriving
from the class won't solve the problem since the GetError method is not
virtual.
Has anyone seen this too? Do you know of a way to prevent it?
Thanks for any help. Tag: picture preview controls Tag: 80143
DataGrid and Texbox Focus
I have a data grid and a textbox on the same form. When the form is opened
and the datgrid is displayed the focus goes there, not to the textbox. I
have tried to use textbox1.focus() on the textbox but it doesn't work.
How can I get the focus on the textbox, not the datagrid. Tag: picture preview controls Tag: 80142
DataGrid with DateTime
Hi,
I have encountered the problem:
1. I have a sql server with a table in it.
2. One of the column's type in the table is datatime.
2. I have a form taht contains a datagrid control.
3. I attached the datagrid to the table in the DB.
One of the cells in the table contains the following data (datetime):
11/8/2004 4:14:37 PM
(I can see that if I open the DB through the server explorer in visual
studio).
When I run my application, and the DB is attached to the grid, the cell
contains:
11/8/2004
(thats what I see in the grid when I run the application- the time is
missing).
Is there something I forgot to do?
Do I have to configure something?
Help will be appreciated,
Regards,
Ram. Tag: picture preview controls Tag: 80141
windows form size at display time
Hi,
I am a new user to VB.NET. In the past I never had trouble with creating a
windows form adding objects and then having it display the same size at run
time.
I have a form that is exactly the size I want it to be at run time however
it is about 20% shorter and 10% narrower at run time , which causes controls
not to show up, and some of them are stacking a little bit over each other.
How do I make my form appear exactly at run time as it is in design?
P.S: I think it might have something to do with the new feature of docking
objects to other controls(i.e. : panels) but I have'nt actively done this
knowingly on my part.
thanks
Chris Tag: picture preview controls Tag: 80140
Docking control help!
Hello!
I have a main form, in which there is a Menu (main Menu, at top), Toolbar
(below Main menu), ListView (left, below toolbar), a statusbar and a child
form with DataGrid on it appears every time when click on items of listview
respectively.
Problems:
I need to dock the ListView below toolbar and on the left part of main form
above the status bar.
The child form below tool bar and next to the listview and lengthens to the
right boder of main form and above statusbar.
so, How can i do it programmatically?
Thanks for all your help! Tag: picture preview controls Tag: 80139
finding all the opened forms
I have an application that has a main form and a user can create a number of
other forms at run time. Most of those forms are created through reflection
by first using Assembly.CreateInstance to create the object then get the
methodInfo of a certain method, and finally calls MethodInfo.Invoke.
At certain point of the execution I need to close all those forms except my
main form.
Anybody knows if there is a way of finding all those forms from my main
form?
Thanks. Tag: picture preview controls Tag: 80138
How to design MainMenu to show images
Hi,
I try to show the images from ImageList in the MainMenu MenuItems but it
seems there is no easy way to do this by editing the properties of the
MenuItem.
Can anyone tell me a common technique for doing this. Tag: picture preview controls Tag: 80135
Application Icon
seems like a really simple question after some of the things I've managed to
do but...how do I set up my application so that it has a custom icon rather
than the windows explorer .exe standard icon?
The icon that I want to use is a BMP format picture at the moment.
Can anyone help???
Many thanks
James Tag: picture preview controls Tag: 80124
Visual Basic .net Datagrid witout Insert
Hi,
I'm trying to create a Configuration Form with a datagrid. What I want to do
is to show the values which may be edited, but no new row should be add. So,
how can I show a datagrid without an insert-Row (*).
Thanks for help,
haerry Tag: picture preview controls Tag: 80122
need help in hosting UserControl in IE
Hello developers!
I`ve created an assembly and I host a UserControl-derived class from it in
IE using <object> tag. Like this:
<object id="upload1"
classid="Foo.dll#BarCompany.Foo" width="1000" height="500">
<param name="xxxx" value="yyyy">
</object>
And everything works.
However, when I strong-name this assembly this BarCompany.Foo control is not
loaded, and IE shows an image placeholder.
Maybe there`s a special classid value for this case or something I missed?
Thank you for advices and help! Tag: picture preview controls Tag: 80120
TopMost
Hi,
I have a problem with TopMost Of the Form. I have already set the
TopMost is true. but it doesn't overlaps all the other (non-topmost) forms.
Could you tell me why this problem happend.
Thanks, Tag: picture preview controls Tag: 80114
Sending Mail from a WinForms client
I'm wanting to include in my WinForms app the ability to send an email.
Is it possible, and what is method to take, to send email from within a
forms app, ideally using the user's mail account. What I would like to
avoid is having to setup special mail servers/SMTP servers. If their
Outlook Express client can send mail, can I a stuff message through that
connection?
Currently if I do this:
Dim msg As New MailMessage
With msg
.To = "name@domain.com"
.From = "My App"
.Subject = "My Subject"
.Body = "My Body"
.BodyFormat = MailFormat.Text
End With
SmtpMail.SmtpServer = "MachineName"
SmtpMail.Send(msg)
....I get a Could not access 'CDO.Message' object. error.
Many thanks everyone.
--
===
Phil
(Auckland | Aotearoa) Tag: picture preview controls Tag: 80112
How to Size the form to Maximum at OnPaint??
Hi all!
I want to know hot to make the form to maximal size (=desktop size) at the
moment of OnPaint?
Thanks in advance! Tag: picture preview controls Tag: 80103
Am I Going Crazy?
I'm using the office add-in to create a word document based on a template
file.
In some areas of the document I need to insert a LineBreak (Not a new
paragraph) into the document. So far I can't figure out how to do this.
Can anyone help?
--
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer
www.aboutfortunate.com
"Out of chaos comes order."
Nietzsche Tag: picture preview controls Tag: 80101
Problem with DragDrop between 2 textboxes
I created a new vb windows application and dragged 2 textboxes onto Form1.
Then I coppied the code below from MSDN article
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vbtchimpdragdrop.asp).
The code for TextBox1 executes OK, but fails to execute for TextBox2 . Can
anyone shed some light on this for me?
Thanks.
Private MouseIsDown As Boolean = False
Private Sub TextBox1_MouseDown(ByVal sender As Object, ByVal e As _
System.Windows.Forms.MouseEventArgs) Handles TextBox1.MouseDown
' Set a flag to show that the mouse is down.
MouseIsDown = True
End Sub
Private Sub TextBox1_MouseMove(ByVal sender As Object, ByVal e As _
System.Windows.Forms.MouseEventArgs) Handles TextBox1.MouseMove
If MouseIsDown Then
' Initiate dragging.
TextBox1.DoDragDrop(TextBox1.Text, DragDropEffects.Copy)
End If
MouseIsDown = False
End Sub
Private Sub TextBox2_DragEnter(ByVal sender As Object, ByVal e As _
System.Windows.Forms.DragEventArgs) Handles TextBox2.DragEnter
' Check the format of the data being dropped.
If (e.Data.GetDataPresent(DataFormats.Text)) Then
' Display the copy cursor.
e.Effect = DragDropEffects.Copy
Else
' Display the no-drop cursor.
e.Effect = DragDropEffects.None
End If
End Sub
Private Sub TextBox2_DragDrop(ByVal sender As Object, ByVal e As _
System.Windows.Forms.DragEventArgs) Handles TextBox2.DragDrop
' Paste the text.
TextBox2.Text = e.Data.GetData(DataFormats.Text)
End Sub
--
moondaddy@nospam.com Tag: picture preview controls Tag: 80096
CodeSwap Addin
microsoft.public.dotnet.framework
microsoft.public.dotnet.framework.windowsforms
microsoft.public.dotnet.general
All - I am tring to add the CodeSwap addin to VS.Net 2003 and no errors are
reported in the setup but I do get them in the event log. Any ideas on how
to resolve this issue?
Thanks,
Brian
Event Type: Error
Event Source: CodeSwapAddin Setup
Event Category: None
Event ID: 0
Date: 11/6/2004
Time: 9:18:14 PM
User: N/A
Computer: BPH
Description:
System.ComponentModel.Win32Exception: The system cannot find the path
specified
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo
startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at VSAddinSetup.AddinReg.ExecuteRegAsm(String dllName)
For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp. Tag: picture preview controls Tag: 80095
Can I send data to a console app from a win form
Hi,
I need to send data to a running console app. The console app is a kind of
terminal service application. This console app has a input text box and I
need to send a text string to fill in this text box. So the user can hit
enter to run his consle app. How can I do it? It assumed that the console
is always up and running and waiting for input. Thanks in advance.
Steve Tag: picture preview controls Tag: 80091
How to Un-Activate an app
Hi:
I would like to activate / un-acitvate my app's from time to time. I like
to do some action whenever the app is activated and in there the I will
un-activate it, waiting for external signal to activate it and do the same
action again and again. I put the action in the (main) Form.Activated event
handler, it does once. I have to click other application, in order to have my
app to lose focus, and click my app to get activated again to fire the
Activated handler
How do I un-acitivate the app, if possible, so it wil be ready to get
activated again and again automatically. Tag: picture preview controls Tag: 80090
ListView control header events?
The ListView control allows you to reorder and resize columns, but a cannot
find out how to catch events coming from the header. I have looked at all
the WM_NOTIFY events that come through. Only the click seems to fire.
I would like to be able to save the changes to the header that are made by
the user. How do I do this?
Thanks for any help.
Alfredo Tag: picture preview controls Tag: 80087
Export datagrid to excel and access
Hi,
Does anyone know how to export a Windows forms datagrid to Access and excel.
I have a datagrid and want to click a button an export the data to excel and access.
Thanks Tag: picture preview controls Tag: 80085
Newbie Help
How do I perform an undo in a datagrid? Below is the code that I am trying
to work with and it is not working. School11 is my dataset, Student is a
table in an access db. I am using a Windows Form with a datagrid1. Can
someone please give me a hand?
Private Sub btnUndo_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnUndo.Click
School11.Tables("Student").RejectChanges()
DataGrid1.Refresh()
End Sub() Tag: picture preview controls Tag: 80082
using Webbrowser control (SHDocVw) to navigate file system
This is not a problem itself by using:
AxWebBrowser1.Navigate("C:\Documents and Settings\Calvin Ouyang\My
Documents\My Pictures"). However sinceI am browsing the My pictures
folder, I want to show the thumbnail view. Is a way I can control that
by using this webbrowser control (SHDocVw)?
Thhanks a lot.
Calvin Tag: picture preview controls Tag: 80077
updating winform
Hi,
I am having issue w/ threading. I have a datagrid and I want to run
FillDG() in different thread and once it finishes, I want to bind the data.
private void button1_Click(object sender, System.EventArgs e)
{
Thread t = new Thread(new ThreadStart(FillDG));
t.Start();
// I don't know what to put here to wait for t to finish
// I tried t.Join(); but this locked up the win form, i.e. I can't move the
form around
myDataGrid.SetDataBinding(myDataSet, "myDataTable");
}
Please advice, thanks!
-P Tag: picture preview controls Tag: 80074
hWnd question...
I am not sure that I understand what the Control.Handle value represents.
The MSDN documentation say that it is "the window handle that the control is
bound to." Does this mean that the handle is for the control itself or for
the control's parent form?
I am trying to call a Win32 API metohd that will set the scroll position of
UserControl. The method requires an hWnd, and I am wondering if the
control's base.Handle would give me that value.
Any insight would be appreciated.
Thanks! Tag: picture preview controls Tag: 80070
OpenFileDialog box problem
Hello,
I am using an OpenFileDialog box to upload a file into my program. It
works, unless the user clicks on the My Documents folder. If you go through
the c: listing, you can access the My Documents folder. However, if you
click the button on the left side of the dialog box or try to click directly
to My Documents without going through the c:, the entire program freezes.
Any ideas what is happening?
Thanks Tag: picture preview controls Tag: 80065
Can ShowHelp handle a url that targets a name containing spaces?
Hi,
I have a helpfile where there happens to be name anchors containging spaces,
e.g. <a name="name with space">
Can I pass my arguments to ShowHelp in a way that will navigate to the name?
I tried something like this:
string file= @"C:\path with space\myhelp.chm";
string topic="html/concepts.htm#concept name";
Help.ShowHelp(this, file, HelpNavigator.Topic, topic);
The file shows up with the correct page (concepts.htm", but it doesn't
navigate to the name.
I know it is bad practice to have spaces in names, but I am not in power to
change this.
Is there any way I can get the help up correctly?
Greatful for any hints.
Anna Neiderud
(Also, I am trying to do the same thing with javascript in a different
setting - any input on that would also be appreciated) Tag: picture preview controls Tag: 80058
Datagrid - set backcolour on individual cells?
How do I set the background colour on an individual cell in a datagrid?
All I want to do is iterate through all the cells and if a cell has a
certain text value ('Unbooked') colour the background in red...
Chris Tag: picture preview controls Tag: 80057
DataGrid ReadOnly Column BUG !
I´ve found a weird behaviour in the DataGrid:
Scenario:
----------
I use a TableStyle with several standard TextBoxColumns within. One of
that columns have the ReadOnly property set to true.
In execution, select the text or a part of it in a cell inside the
ReadOnly column. Then, do something that force the DataGrid to loose
the focus and afterwards something else that changes its contents
(DataSource changed, parent datagrid´s selected row changed,
whatever...)
After that, the text of the cell you selected is not refreshed, so it
still appears in the DataGrid, even if all the rows of the DataGrid
disappeared, the text is still there, by itself, looking at me and
laughing.
The text is refreshed if you give focus to the DataGrid again (by
clicking on it or by manually calling .Focus() ).
Im afraid I´m not using the correct terms to to search in the groups
couse I couldn´t find much about the issue. I think it´s important
enough to fix this, you guys out there ;)
Thanks in advance.
Regards,
Iñaki. Tag: picture preview controls Tag: 80056
Datagrid doubleclick event in cells?
How do I make the doubleclick event fire when a user double clicks in a
datagrid cell? It only seems to work when they click on the border or
columns. Tag: picture preview controls Tag: 80055
searching in a listbox explorer style
Hi
If you have multiple items in a listbox, click into the listbox, then type
for instante the letter "p", the first item whose text property starts with
"p" will be selected. Pressing "p" again will jump to the next item starting
with "p", etc.
In Windows explorer, you can type multiple letters after each other, and if
you're fast enough, they'll be taken as a search term together. For instance
pressing "p" then "e" then "a" would lead to the first folder/file whose
name starts with "pea" being selected.
Is there any way to achieve this functionality in a Listbox as well?
Regards
Stephan Steiner Tag: picture preview controls Tag: 80045
Custom Focus
Is there some interface I have to implement to make a custom control recieve
focus (and be recognized as recieving focus)?
Thanks everyone.
--
===
Phil
(Auckland | Aotearoa) Tag: picture preview controls Tag: 80042
OpenFileDialog and DataSet WriteXML strange problem
Hi,
I have a very strange problem which i hope someone can help shed light on.
I have a Windows Forms application which provides data-entry UI. Data
inputted is then stored into a DataSet which will be persisted into a XML
file using the WriteXML method.
The Dataset which contains a Filename data column (type = string); A user
selects a file using the OpenFileDialog component. The file name is
displayed in a textbox until the user clicks on the Save button.
PROBLEM:
If the file is selected using the OpenFileDialog.ShowDialog() method, the
file name is added to the dataset, but it is not written to the XML file.
However, if the filename is manually typed into the textbox, saving to XML
file succeeds.
Further tests shows that this problem only shows up in WinXP system.
Machines running 2000 saves the XML file just fine. In the event of failure,
no exceptions nor errors are shown.
This is a very strange problem, any help will be very much appreciated!
Thanks,
nick Tag: picture preview controls Tag: 80034
2 Datagrids AllowNew
Hi
Have two Datagrids in a Master Detail relationship, used the example from
syncfusion to bind to a currency manager and set the allowNew to false, but
it does not work for my child datagrid.
Any help would be great.
thanks dave.
here is some code
// Connection Adapters
CBAdapter = new OleDbDataAdapter("Select * From tblCashBook", CBConnect) ;
CBAdapterSplit = new OleDbDataAdapter("Select * From tblCashBookSplit",
CBConnect) ;
CBDataset = new DataSet();
CBConnect.Open() ;
CBAdapter.Fill(CBDataset, "tblCashBook") ;
CBAdapterSplit.Fill(CBDataset, "tblCashBookSplit") ;
// Setting up datagrid columnstyles
DGCashBook_SetupColumnStyles();
DGCashBookSplit_SetupColumnStyles();
CBDataset.Relations.Add("CashBookToSplit", CBDataset.Tables
["tblCashBook"].Columns["SplitNumber"],
CBDataset.Tables["tblCashBookSplit"].Columns["SplitNumber"]);
this.DGCashBook.DataSource = CBDataset.Tables["tblCashBook"];
this.DGCashBookSplit.DataSource = CBDataset.Tables["tblCashBook"];
this.DGCashBookSplit.DataMember = "CashBookToSplit";
this.DGCashBook.AllowNavigation = false;
CBCmdBuilder = new OleDbCommandBuilder(CBAdapter);
CBCmdBuilderSplit = new OleDbCommandBuilder(CBAdapterSplit);
// Bind CM to Parent Datagrid
cm = (CurrencyManager)this.BindingContext[DGCashBook.DataSource];
((DataView)cm.List).AllowNew = false;
// Bind CM2 to Child Datagrid
cm2 = (CurrencyManager)this.BindingContext[this.DGCashBookSplit.DataSource,
this.DGCashBookSplit.DataMember];
((DataView)cm2.List).AllowNew = false;
// tried navigate navigate handler for both datagrids but still does not work
this.DGCashBook.Navigate += new NavigateEventHandler(DGCashBook_Navigate);
CBConnect.Close(); Tag: picture preview controls Tag: 80029
Refresh current form to reflect culture change
Hi everybody,
I want to add localization support into my windows forms application.
Basically, I create a menu item where users can choose a language of their
choice. When users choose their preferred language, I want to update all the
texts/labels on the current form UI to the new culture, instantaneously.
For this, I have created a .resx file for each supported culture and in the
event handlers for menu item's Click event, I change the CurrentUICulture
property to the corresponding culture as follow:
System.Threading.Thread.CurrentThread.CurrentUICulture = new
System.Globalization.CultureInfo("en-US");
However, when the program runs, nothing happens. So, I guess I must somehow
force the form to reload itself. I've tried all the methods like
Form.Update(), Form.Refresh(), Form.Invalidate(), ... but unsuccessful so
far.
Does anybody know the solution to this scenario ?
Thanks a lot
SuperKinhLuan Tag: picture preview controls Tag: 80028
Is Any person know how to set a hotkey for command button?
Dear all,
I have no idea to set a hot key for the command button in my VB window
application program. Do any person know how to do it?
Thank you
miyakejess Tag: picture preview controls Tag: 80025
Get system currently selected text
Hi all,
I'm facing a problem with my Windows Forms app. When my main Form is
activated, I want to capture the currently selected text from any other
programs (Word, IE, Notepad, ...) for further processing.
How could I do that ? I guess I have to rely on P/Invoke, but no idea how to
do it. Anybody can help me ?
Thanks in advance
Dotnetjunky Tag: picture preview controls Tag: 80021
Panel controls autoscroll not working
I have been having problems with a panel control since installing Windows XP
SP2 and .Net framework 1.1 sp1. I have several forms in an application which
contains several panels. One of the panels contains a panel which has
controls added to it at runtime with the autoscroll property set to true.
Some of the controls added are outside the visible range of the panel.
Before the service packs the panel would have a scroll bar. Also when a
child control outside of the visible range gained focus, the panel would
autoscroll so that the control was visible.
After the service packs, the panel scroll bar will not show up for controls
added during runtime. If I add a control at design time outside the visible
range of the panel, the scroll bar will appear. However, when the control
gains focus the panel autoscroll position go to 0 instead of what is
necessary to keep the active control in view.
Has anyone had similar problems and/or know how to fix this problem? Thank
you in advance. Tag: picture preview controls Tag: 80011
Input Box
This is a multi-part message in MIME format.
------=_NextPart_000_0006_01C4C320.A00B4740
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,=20
C# has MessageBox which is convenient to use. Does C# has Input Box? =
Even though it's easy to create, if there is one in C#, why shouldn't I =
use it.
Thanks,
Dennis
------=_NextPart_000_0006_01C4C320.A00B4740
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.2180" 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>C# has MessageBox which is convenient to use. Does =
C# has=20
Input Box? Even though it's easy to create, if there is one in C#,=20
why shouldn't I use it.</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_0006_01C4C320.A00B4740-- Tag: picture preview controls Tag: 80010
MDI scroll bars appear onresize around mdichild
Hello,
I have an MDI form with a child form that opens on load window state set
normal on MDI. I want resize the child on the MDI onresize event. I run
the app (form) then drag an edge of the MDI larger than its start up size
and scroll bars appear arround the mdichild that is resizing with it. If
the MDI window state is set to maximize this does not occur. What am I
missing? Seems like a simple thinhg to do.
Private Sub f_main_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'MDI not maximized
Dim f As New f_menu
f.Width = Me.Width - 50
f.Height = Me.Height - 50
f.MdiParent = Me
f.Show()
End Sub
Protected Overrides Sub OnResize(ByVal e As System.EventArgs)
If Me.MdiChildren.Length > 0 Then
Dim f As Form
f = Me.ActiveMdiChild
f.Width = Me.Width - 50
f.Height = Me.Height - 50
End If
End Sub
Thanks for looking...
Brian Tag: picture preview controls Tag: 80008
Inherit ListView Column Header
Hi All,
I have been looking at this for a little while now and can't figure it out.
I was hoping someone could help.
I needed to have an aditional property for the ColumnHeader object contained
in the ListView Columns collection. I needed this property to map ListView
columns to DataTable columns for a suedo databinding function. I though
perhaps inherit from the listview and ColumnHeader objects. Here are the
steps and code:
STEP 1: Create a ColumnHeader object that inherits from ColumnHeader with
the additional property
Public Class DataBoundColumnHeader
Inherits ColumnHeader
Private m_BoundColumn As String 'new property
Public Sub New()
MyBase.New()
End Sub
<Category("Data")> _
Public Property BoundColumn() As String
Get
Return Me.m_BoundColumn
End Get
Set(ByVal Value As String)
Me.m_BoundColumn = Value
End Set
End Property
End Class
STEP 2: Create a ColumnHeaderCollection object that inherits from
ColumnHeaderCollection and shadows functions which assign and retrieve my
custom DataBoundColumnHeader object
Public Class DataBoundColumnHeaderCollection
Inherits ListView.ColumnHeaderCollection
Public Sub New(ByVal Owner As ListView)
MyBase.New(Owner)
End Sub
Default Public Shadows ReadOnly Property Item(ByVal Index As
Integer) As DataBoundColumnHeader
Get
Return CType(MyBase.Item(Index), DataBoundColumnHeader)
End Get
End Property
Public Shadows Function Add(ByVal Column As DataBoundColumnHeader)
As Integer
Return MyBase.Add(Column)
End Function
Public Shadows Function Add(ByVal Text As String, ByVal width As
Integer, _
ByVal TextAlign As HorizontalAlignment) As DataBoundColumnHeader
Return CType(MyBase.Add(Text, width, TextAlign),
DataBoundColumnHeader)
End Function
'This should be public: but a conversion type error occurs
Private Shadows Sub AddRange(ByVal Values() As
DataBoundColumnHeader)
MyBase.AddRange(Values)
End Sub
End Class
STEP 3: Create a ListView object that inherits from ListView shadowing the
Columns property to accept my ColumnHeaderCollection
Public Class DataBoundListView
Inherits System.Windows.Forms.ListView
Private m_DataBoundColumns As New
DataBoundColumnHeaderCollection(Me)
<Category("Behavior"), _
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)>
_
Public Shadows ReadOnly Property Columns() As
DataBoundColumnHeaderCollection
Get
Return m_DataBoundColumns
End Get
End Property
End Class
THE PROBLEM:
PROBLEM 1: This will not work unless the shadowed function AddRange is
private and not public: The error is a typeconversion error
PROBLEM 2: When I add the DataBoundListViewControl to a form and add some
columns I get the following automatically generated code:
'Notice the System.Windows.Forms.ColumnHeader object
Me.DataBoundListView1.Columns.AddRange(New
System.Windows.Forms.ColumnHeader() {Me.DataBoundColumnHeader9,
Me.DataBoundColumnHeader10})
Me.DataBoundListView1.Location = New System.Drawing.Point(72, 104)
Me.DataBoundListView1.Name = "DataBoundListView1"
Me.DataBoundListView1.TabIndex = 0
Me.DataBoundListView1.View = System.Windows.Forms.View.Details
The automatic code generator creates an array of new ColumnHeader objects
but assigns DataBoundColumnHeader ojects to items in that array. This is a
little confusing. I really prefer it creates an array of
DataBoundColumnHeader objects and then I could make my Private AddRange,
Public.
Thanks in advance,
Demetrio Tag: picture preview controls Tag: 80007
Hello all,
has anyone seen datagrid-like controls such as thumbnail preview of pictures
(like in windows explorer) or sample how to implement this?
DD> Hello all,
DD> has anyone seen datagrid-like controls such as thumbnail preview of
DD> pictures
DD> (like in windows explorer) or sample how to implement this?
DD> Thank you.
DD>