How make item in listbox selected when mouse over it
Hi all,
When mouse move over the item I get the position of mouse anh then get index
of item.
When listbox control have scroll bar, how can I get i temin mouse position.
Please tell me!
Thank in advance. Tag: MDI FORMS Tag: 59626
chain of responsibility
Has anyone got a practical C# example of using the chain of responsibility
in Windows Forms?
For example, I have a button inside a container inside a TabPage, etc.
If I click on the button I want to send a notify event up through the
hierarchy.
Thanks,
Jamie. Tag: MDI FORMS Tag: 59625
Form Resize
Hi,
When i do a dock change (meaning changing a component's
docking property) the screen flickers. Is there a way to
control flickering effect and provide a smooth resize.
Thanks,
Jagan Mohan Tag: MDI FORMS Tag: 59622
How to drop down menu at run time?
hi,
im building a voice enabled application using VC#,in which
we try to control the menu using Voice commands.. for
example if thereb are menus like .. " file " " edit" ..etc
then when i say file.. i want the file menu to drop down..
how do i do that?
plz reply soon
thank you
arjun Tag: MDI FORMS Tag: 59621
combo box selectIndex problem
Hi All,
I have a problem, if I have a combo box, displaying a name with a
valueMember,
when I have a selectIndexChange, I need to get back the value to do the
binding a datagrid, but if the form load, it will fail because selectIndex
is out of range Tag: MDI FORMS Tag: 59616
what .cab should be include in the installation package?
I finish a .net cf application (using SQL CE 2.0), and package it to a .cab
file.
This application is supposed to be run on PPC2003 PPC, should I include .net
cf and SQL CE 2.0 installationn file in the package? Tag: MDI FORMS Tag: 59613
Can Microsoft sue me?
I'm designing GUI for my WinForm and I really liked the Outlook 2003 so I
stared to put list view in a middle, IE control on right and I developed
similar bar that outlook 2003 have on the left. This software is to be into
Electrical Industry has nothing to do with messaging, still it looks very
familiar to outlook...(someone who is used outlook before wouldn't have
problem navigating) now the question. Can I get into trouble by using MS
design?
Main question: can you use the MS design (the controls layout) in your
software? Or do you need special permissions for that??
Thanks in advance Tag: MDI FORMS Tag: 59605
App.EnableVisualStyles kills my Toolbar icons
I am calling Application.EnableVisualStyles() before
calling Application.Run() as prescribed.
I have a Toolbar control docked at the top of the main
program's window. This control is attached to an
ImageList control set for 16x16 bit icons.
When the main window displays there are no icons
displayed on the toolbar buttons.
If I run the app without calling EnableVisualStyles the
toolbar button icons display properly.
Any ideas?
Thanks. Tag: MDI FORMS Tag: 59603
Building menus - Design time / Run time
Hi,
I'm in a bit of indecision now, should I build my menus in design time/run
time. I feel like doing them in run time but after a while I see this
massive amount of code that put me off a bit. Feels like working in Java :P
Anyone has any input?
thanks.
/m Tag: MDI FORMS Tag: 59601
Anchor problem on dynamic form
I have a form inside my application (mdi child) to which
I add a varying number of custom display objects at
runtime. To do this, I suspend layout, add the items,
and then resume layout. I am having a problem with the
header image of the page. Since the form is resizable, I
am trying to anchor a picturebox to the top of the form.
When I do this, the image is drawn off center by 100
pixels to the left or so (and moves with a resize). If I
anchor it top and left, it works fine but is not centered
in the screen (and does not move with a resize, as one
would expect). Has anyone seen this type of behavior?
Thanks in advance.
-Rob Tag: MDI FORMS Tag: 59596
How to have a control docked outside the form?
I want to have a control with no visibility.
Something like the error control, so I want it docked
outside my form in the bottom of the screen.
Anybody knows how to do that? Tag: MDI FORMS Tag: 59594
Bizarre bug: Can't close form
Hi,
One day, when I was testing my application, I tried to use the
main form's close button to exit it, but it didn't work. I right-clicked the
taskbar's icon and used the close menu item, but it didn't work either. I
stopped execution and added an exit menu item (using Form.Close(); the
application is in the early stages of development), but it also didn't work
when I ran it again. What's wrong? I haven't done anything out of the
ordinary to prevent the form from closing!
Here is the form's code. I'm still using VB.NET 2002 & .NET 1.0.
Help!
' Declaração de importações
Imports System.Windows.Forms
Imports Normando.Focus.Controls
Public Class Main
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
' Associa os eventos da botão Serviços
AddHandler ServicesPage.Click, AddressOf Pages_Click
AddHandler ServicesPage.MouseEnter, AddressOf Pages_MouseEnter
AddHandler ServicesPage.MouseLeave, AddressOf Pages_MouseLeave
' Associa os eventos da botão Cadastros
AddHandler RecordsPage.Click, AddressOf Pages_Click
AddHandler RecordsPage.MouseEnter, AddressOf Pages_MouseEnter
AddHandler RecordsPage.MouseLeave, AddressOf Pages_MouseLeave
' Associa os eventos da botão Relatórios
AddHandler ReportsPage.Click, AddressOf Pages_Click
AddHandler ReportsPage.MouseEnter, AddressOf Pages_MouseEnter
AddHandler ReportsPage.MouseLeave, AddressOf Pages_MouseLeave
' Associa os eventos da botão Opções
AddHandler OptionsPage.Click, AddressOf Pages_Click
AddHandler OptionsPage.MouseEnter, AddressOf Pages_MouseEnter
AddHandler OptionsPage.MouseLeave, AddressOf Pages_MouseLeave
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents Tray As System.Windows.Forms.NotifyIcon
Friend WithEvents MenuBar As System.Windows.Forms.MainMenu
Friend WithEvents Pages As System.Windows.Forms.Panel
Friend WithEvents OptionsPage As System.Windows.Forms.Label
Friend WithEvents ReportsPage As System.Windows.Forms.Label
Friend WithEvents RecordsPage As System.Windows.Forms.Label
Friend WithEvents ServicesPage As System.Windows.Forms.Label
Friend WithEvents Page As System.Windows.Forms.Panel
Friend WithEvents FileMenu As System.Windows.Forms.MenuItem
Friend WithEvents FileExit As System.Windows.Forms.MenuItem
Friend WithEvents HelpMenu As System.Windows.Forms.MenuItem
Friend WithEvents HelpContents As System.Windows.Forms.MenuItem
Friend WithEvents HelpSeparator As System.Windows.Forms.MenuItem
Friend WithEvents HelpAbout As System.Windows.Forms.MenuItem
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Me.Tray = New System.Windows.Forms.NotifyIcon(Me.components)
Me.MenuBar = New System.Windows.Forms.MainMenu()
Me.FileMenu = New System.Windows.Forms.MenuItem()
Me.FileExit = New System.Windows.Forms.MenuItem()
Me.HelpMenu = New System.Windows.Forms.MenuItem()
Me.HelpContents = New System.Windows.Forms.MenuItem()
Me.HelpSeparator = New System.Windows.Forms.MenuItem()
Me.HelpAbout = New System.Windows.Forms.MenuItem()
Me.Pages = New System.Windows.Forms.Panel()
Me.OptionsPage = New System.Windows.Forms.Label()
Me.ReportsPage = New System.Windows.Forms.Label()
Me.RecordsPage = New System.Windows.Forms.Label()
Me.ServicesPage = New System.Windows.Forms.Label()
Me.Page = New System.Windows.Forms.Panel()
Me.Pages.SuspendLayout()
Me.SuspendLayout()
'
'Tray
'
Me.Tray.Text = ""
Me.Tray.Visible = True
'
'MenuBar
'
Me.MenuBar.MenuItems.AddRange(New System.Windows.Forms.MenuItem()
{Me.FileMenu, Me.HelpMenu})
'
'FileMenu
'
Me.FileMenu.Index = 0
Me.FileMenu.MenuItems.AddRange(New System.Windows.Forms.MenuItem()
{Me.FileExit})
Me.FileMenu.Text = "&Arquivo"
'
'FileExit
'
Me.FileExit.Index = 0
Me.FileExit.Text = "Sai&r"
'
'HelpMenu
'
Me.HelpMenu.Index = 1
Me.HelpMenu.MenuItems.AddRange(New System.Windows.Forms.MenuItem()
{Me.HelpContents, Me.HelpSeparator, Me.HelpAbout})
Me.HelpMenu.Text = "A&juda"
'
'HelpContents
'
Me.HelpContents.Index = 0
Me.HelpContents.Text = "&Conteúdo"
'
'HelpSeparator
'
Me.HelpSeparator.Index = 1
Me.HelpSeparator.Text = "-"
'
'HelpAbout
'
Me.HelpAbout.Index = 2
Me.HelpAbout.Text = "&Sobre o Focus Café..."
'
'Pages
'
Me.Pages.BackColor = System.Drawing.Color.FromArgb(CType(64, Byte),
CType(64, Byte), CType(64, Byte))
Me.Pages.Controls.AddRange(New System.Windows.Forms.Control()
{Me.OptionsPage, Me.ReportsPage, Me.RecordsPage, Me.ServicesPage})
Me.Pages.Dock = System.Windows.Forms.DockStyle.Top
Me.Pages.Name = "Pages"
Me.Pages.Size = New System.Drawing.Size(488, 24)
Me.Pages.TabIndex = 6
'
'OptionsPage
'
Me.OptionsPage.BackColor = System.Drawing.Color.Transparent
Me.OptionsPage.ForeColor = System.Drawing.Color.LightGray
Me.OptionsPage.Location = New System.Drawing.Point(184, 2)
Me.OptionsPage.Name = "OptionsPage"
Me.OptionsPage.Size = New System.Drawing.Size(56, 20)
Me.OptionsPage.TabIndex = 3
Me.OptionsPage.Tag = "OrdersPage"
Me.OptionsPage.Text = "Opções"
Me.OptionsPage.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'ReportsPage
'
Me.ReportsPage.BackColor = System.Drawing.Color.Transparent
Me.ReportsPage.ForeColor = System.Drawing.Color.LightGray
Me.ReportsPage.Location = New System.Drawing.Point(120, 2)
Me.ReportsPage.Name = "ReportsPage"
Me.ReportsPage.Size = New System.Drawing.Size(64, 20)
Me.ReportsPage.TabIndex = 2
Me.ReportsPage.Tag = "SuppliersPage"
Me.ReportsPage.Text = "Relatórios"
Me.ReportsPage.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'RecordsPage
'
Me.RecordsPage.BackColor = System.Drawing.Color.Transparent
Me.RecordsPage.ForeColor = System.Drawing.Color.LightGray
Me.RecordsPage.Location = New System.Drawing.Point(56, 2)
Me.RecordsPage.Name = "RecordsPage"
Me.RecordsPage.Size = New System.Drawing.Size(64, 20)
Me.RecordsPage.TabIndex = 1
Me.RecordsPage.Tag = "ClientsPage"
Me.RecordsPage.Text = "Cadastros"
Me.RecordsPage.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'ServicesPage
'
Me.ServicesPage.BackColor = System.Drawing.Color.Transparent
Me.ServicesPage.ForeColor = System.Drawing.Color.LightGray
Me.ServicesPage.Location = New System.Drawing.Point(0, 2)
Me.ServicesPage.Name = "ServicesPage"
Me.ServicesPage.Size = New System.Drawing.Size(56, 20)
Me.ServicesPage.TabIndex = 0
Me.ServicesPage.Tag = "StartPage"
Me.ServicesPage.Text = "Serviços"
Me.ServicesPage.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'Page
'
Me.Page.Dock = System.Windows.Forms.DockStyle.Fill
Me.Page.Location = New System.Drawing.Point(0, 24)
Me.Page.Name = "Page"
Me.Page.Size = New System.Drawing.Size(488, 374)
Me.Page.TabIndex = 7
'
'Main
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.BackColor = System.Drawing.Color.FromArgb(CType(224, Byte), CType(224,
Byte), CType(224, Byte))
Me.ClientSize = New System.Drawing.Size(488, 398)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Page, Me.Pages})
Me.Menu = Me.MenuBar
Me.Name = "Main"
Me.Text = "Focus Café"
Me.Pages.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub Pages_MouseEnter(ByVal sender As Object, ByVal e As
System.EventArgs)
' Ilumina a etiqueta da página
Dim PageLabel As Label = DirectCast(sender, Label)
PageLabel.BackColor = Color.LightGray
PageLabel.ForeColor = Color.DimGray
End Sub
Private Sub Pages_MouseLeave(ByVal sender As Object, ByVal e As
System.EventArgs)
' Escurece a etiqueta da página
Dim PageLabel As Label = DirectCast(sender, Label)
PageLabel.BackColor = Color.Transparent
PageLabel.ForeColor = Color.Gainsboro
End Sub
Private Sub Pages_Click(ByVal sender As Object, ByVal e As System.EventArgs)
' Obtém o botão pressionado
Dim Button As Label = DirectCast(sender, Label)
' Simplifica o acesso à coleção de controles
With Page
' Testa se a página ativa não é a mesma que tenta-se
' exibir
If Not .Controls(0).GetType().Name.ToUpper() = Button.Name.ToUpper() Then
' Remove a página anterior
.Controls.Clear()
' Exibe a nova página
.Controls.Add(Activator.CreateInstance(Type.GetType("Normando.Focus.Cafe.Ser
ver." + Button.Name)))
.Controls(0).Dock = DockStyle.Fill
End If
End With
End Sub
Private Sub Main_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
' Cria a página inicial
Dim StartPage As ServicesPage = New ServicesPage()
StartPage.Dock = DockStyle.Fill
' Adiciona a página inicial no container
Page.Controls.Add(StartPage)
End Sub
Private Sub FileExit_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles FileExit.Click
' Sai do programa
Close()
End Sub
End Class Tag: MDI FORMS Tag: 59588
.NET Framework 1.0 Validating event bug?
Hi,
I'm putting together an app where I need to be
able to stop the user from switching focus from
a control (e.g. a DataGridTextBox) if the value
in the box is bad. I have a test app where I
dump out a log message on all the standard events
(enter/leave/validating/validated, etc.). When
I'm in a DG cell and enter a bad value (checked
during Validating and set e.Cancel = true), I've
found that events past Validating continue.
In this case, the DG's MouseDown handler is called,
then a whole bunch more entering and leaving (including
of the original textbox and ultimately the bad value
is sent through ColumnChanging on the DataTable under
the grid.
Any idea why Validating doesn't seem to stop the
event progression? Setting Cancel = true stops
the Validated event from showing up, but does
nothing about the MouseDown and later stuff.
Are there known bugs in .NET 1.0 about this? I was
unable to find anything in searching the MSDN
Knowledge Base and various Google references.
Any help (including "it works in 1.1, use that")
would be GREATLY appreciated!
Thanks,
Dave Combs
combs@edgedynamics.com Tag: MDI FORMS Tag: 59586
disabled toolbar button images
An exhaustive search of all dotnet groups seems to indicate that no
one has been able to solve the problem of disabled toolbar button
images providing a grey box or some other lame appearance.
Has anyone been able to solve this? From the postings it sounds like
it may have something to do with the imagelist transparency color, the
imagelist color depth, and possibly the original image file color
depth. Anyone?
Scott. Tag: MDI FORMS Tag: 59585
Control Names in the designer
I have a control with a property of type collection with a
special editor that lets me select controls from the
available controls on the form.
When clicking the "..." on that property, I build a list
of all the controls in order to show what's available.
I'm using the .Name property of each control on the form.
The problem is with "my" controls as opposed to the dotNet
controls.
If I have a TextBox on the form and I change it's name in
the property window, then the next time I view the list of
controls I see the new name. But when I do the same
with "my" control (which inherits either from Control or
from UserControl) the name isn't changed.
Has anyone seen this behaviour ? Tag: MDI FORMS Tag: 59584
form returning on event
hi
how can i make a form return a value on a event (keypress).
I cant do it from inside the event handler code ('return' statement in a Sub
or a Set cannot return a value) Tag: MDI FORMS Tag: 59581
Visual Studio selection frame
hiya-
i am trying to implement a selection frame like visual
studio has in the form designer when you select a control
on a form. the frame has little handles for resizing and
allows the user to know what controls are selected.
i wrote a control that does this and it works well except
for one thing. the frame needs to be one layer below the
selected control. i have found no methods to set the z
order other than bringtofront/sendtoback.
anyone have any thoughts on how ms implmented there
selection frame or a better way to do mine. basically i
want it to be as close as possible to what is in visual
stuido.
thanks - fragget Tag: MDI FORMS Tag: 59578
Returning value from specific cell in a datagrid row
Hi
i have made a datagrid with a number of rows and made sure it selects the
entire row when you click a single cell. but now i have to make the datagrid
Return the value in the first cell in the selected row. how is that possible
(its a indexnumber from a order database)? Tag: MDI FORMS Tag: 59574
Form AfterLoad
I need to execute some code after the form loads. OnLoad
event doesn't work, because it fires before form is
displayed. I need the form to display, and then do
something.
Is there any event that I can use?
Thanks. Tag: MDI FORMS Tag: 59572
tough inheritence question
-Form A inherits from form B.
-I am iterating over the controls on an instance of form A.
-Is there any way for me to tell if a given control came
from form A or form B?
I suspect not, but I thought I'd ask. Tag: MDI FORMS Tag: 59565
How many labels can a form suport
hi there, i'm developing an aplication that uses 4 forms.
Each form has about 2000 labels, when I try to open my
third form, an error ocurrs, but no error mesage appears.
I've realised that if I try to crate a form collection
like:
sub Test()
Dim f as new Form1
f.show
end sub
and if form1 has 300 labels and no other controls, the
program hangs, when the 33rd form appears (about 9900
labels).
What can I do to work this Out ?
Thanks Tag: MDI FORMS Tag: 59563
Picturebox and icons bug?
Hi,
I've come across a strange problem when using the Picturebox to display an
32x32 pixel Icon file. When first setting the "SizeMode" property to
"StretchImage", it seems to work properly (i.e. the Icon is displayed with
the full 32x32 resolution). However after closing and opening the form
designer, the image seems to revert back to 16x16 resolution which looks
horrible when stretched to the 32x32 pixel size of the picturebox.
Here's the steps I used to recreate this problem.
1) Add a picturebox to a form
2) Make it's size 32x32
3) Assign an .ico file to the picturebox's Image Property.
4) Set the "SizeMode" property to "StretchImage". Notice how the icon uses
the full 32x32 resolution.
4) Save and close the form designer.
5) Reopen the form designer - the icon now looks crap with its 16x16
resolution stretched to 32x32
I'm using VB.net in Visual Studio 2003 and .net framework 1.1
Any help anybody can give would be much appreciated.
Best Regards,
Trev. Tag: MDI FORMS Tag: 59561
Listview item activation programatically?
Is it possible to activate a ListView item programatically or, in any other
way, to cause the ItemActivate event from within one's program?
Thanks for any help you might offer. Tag: MDI FORMS Tag: 59558
failed to load resource from resources, please check your setup
L.S.
I get this error:
failed to load resource from resources, please check your setup
when I starting up a deployed C# .net application after the splash
screen on a computer where I installed my application through a setup
wizard. The application is using crystal reports. When I'm logged in
as an administator there's no problem. But when i'm logged in as a
normal user the program doesn't start (installation also doesn't work,
but that's not a big issue, simply install as an administrator)
Erald Kulk Tag: MDI FORMS Tag: 59556
queryengine error
hi,
i created a dataset in runtime. then inserted records into it in runtime
too. then i saved dataset as xml files. then i use to display report using
data from these xml files.
reports are displayed on my comp correctly. but when i install application
on another machin. while displaying report. query engine error messege box
is displayed and report is not displayed.
i tried to show report directly using the dataset i created at runtime. both
ways report is displayed on my machine, but not on any other machine.
can anybody help???
thanks in advance
sachin
PS: if i dont use runtime dataset and insert records in physical table in a
ms-access database. reports are displayed without any glitches. Tag: MDI FORMS Tag: 59555
datagrid backspace delete
We have a datagrid VB6.0 with columns A, B and C. I enter text into A
and then B, then click on C and then click back on B. The cursor is at
end-of-text and I backspace each character to delete the text, then
click on A and text in A is highlighted and I press backspace once and
text is deleted but column B text magically reappears in column B.
What is this? Please - would appreaciate any help. Thank you. Tag: MDI FORMS Tag: 59552
List view problem
Hi!
is their a way to embbed a picture inside a sub item of listview item.
i have a project in wich i want to show a user a seiries of pictures
depending on the state of the row,
the problem is that i can only do that on the Listview Item itself and not
on it's sub items
Please help! Tag: MDI FORMS Tag: 59550
output parameter + Data Reader VB.NET
VB.NET
I want to return an output parameter along with a
DataReader recordset from a stored procedure.
Is it possible?
myReader = CMMD.ExecuteReader --returns data
NumOfRows = CInt(CMMD.Parameters("@NumOfRows").Value) --
Nothing Tag: MDI FORMS Tag: 59549
Crystal Reports - number of pages after drill-down
An application uses Crystal Reports for Visual Studio .NET.
How can you retrieve the number of pages after drill-down in a report?
Code:
CrystalDecisions.Shared.ReportPageRequestContext prc = new
CrystalDecisions.Shared.ReportPageRequestContext();
return rpt.FormatEngine.GetLastPageNumber(prc);
retrieve the number of pages only main report. Tag: MDI FORMS Tag: 59546
failed to load resource from resources, please check your setup
L.S.
I'm trying to install a c# .net application on client machines. When I
start the program as an administrator everything works fine. If I
start as a normal domain user I get the error message:
failed to load resource from resources file, please check your setup.
'
I am changing the locale of the current thread (a threat) to "nl-NL"
it is what seems to be problem. How do I fix this???
greetings
Erald Kulk Tag: MDI FORMS Tag: 59543
Emptying the Controls collection prevents form from closing.
Why does disposing all of the controls and emptying the controls collection
in a form prevent it from closing?
At the minute we have the lovely choice of not destroying our controls and
having a major memory leak, or we destroy the controls, and find ourselves
unable to close the form.
Any advice appreciated.
Cheers,
4Space Tag: MDI FORMS Tag: 59540
ANN: SharpLibrary Version 1.35 Release.
A new update to the SharpLibrary has been released.
Hightlights:
1- Five new samples were added for a total of 52 samples in the
library.
2- A MonthCalendar controls was added which brings the components with
full designer support available from the ToolBox to 46.
3- As usual several fixes/enhacements from the previous release.
For screenshots of the latest release:
http://24.199.8.122/LatestRelease.aspx
Regards,
www.sharplibrary.com Tag: MDI FORMS Tag: 59539
Compare DockStudioXP / DotNetMagic (Docking windows)
Hello,
I'm trying this two component to implement Docking Windows in my
application, but whitch is the better.
Could you tell me your expcrience witich one of these component, the
advantage, the problem, ..., technical support, ...
Web site
http://www.dotnetmagic.com/
http://www.innovasys.co.uk/products/dockstudioxp.asp
Thank's by advance.
Gislain ROCHE Tag: MDI FORMS Tag: 59533
RichTextBox bug
I found a bug in the RichTextBox class that I have yet to see
addressed.
I have an MDI application, with a child window containing a
RichTextBox with its HideSelection property set to false. I write
something to the RichTextBox, and then minimize the child window.
While the child window is minimized, I write some more data to the
RichTextBox. When I restore the child, the RichTextBox is blank! If
I resize or scroll the RichTextBox, the text is displayed again. Tag: MDI FORMS Tag: 59531
Dynamic Datagrid cell color change on timer data input
I have a problem on using Data Grid to paint the cell color when a new
dataset pool from the web service (Timely : 30 second). I had tried
the available sample in the internet , I can change the background
color refer to the same datagrid grid value, but not for the new
DataSet from WebService. Tag: MDI FORMS Tag: 59530
Drag and Drop in List Box
Hi
In a Windows Applications, i want to drag and drag multiple items between
two Listboxes.
Is it possible to drag and drop multiple items?
If yes, how to do that?
Waiting for your reply.
thanks and regards
Karuppasamy Natarajan Tag: MDI FORMS Tag: 59529
ListBox Bug?
I have a Form which contains a ListBox.
I have assigned a EventHandler to the DoubleClick event of the ListBox
Within the event handler I am disposing the form.
After closing the form I get the following exception
*this functionality works fine using a Button.Click
(source code follows)
Unhandled Exception: System.ObjectDisposedException: Cannot access a
disposed object named "ListBox".
Object name: "ListBox".
at System.Windows.Forms.Control.CreateHandle()
at System.Windows.Forms.Control.get_Handle()
at System.Windows.Forms.Control.PointToScreen(Point p)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ListBox.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&
msg)
at System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
this.lstSelect.DoubleClick += new
System.EventHandler(this.lstSelect_DoubleClicked);
private void lstSelect_DoubleClicked(object sender, System.EventArgs
e)
{
this.Hide();
this.Dispose();
}
thanks
Jason Tag: MDI FORMS Tag: 59527
Splash screen
Hi
How to do a splash screen that appears immediately when app starts and lets
other forms load in the background while it is displayed?
Thanks
Regards Tag: MDI FORMS Tag: 59518
Loading Form
Hi
Is it possible to load a few forms without showing them? Will it make
showing of forms any faster when needed?
Thanks
Regards Tag: MDI FORMS Tag: 59517
Screen Resolution, Form Size, and Scrolling
I recently discovered that if you attempt to set the size of a Form
using any method (SetBounds,Size,Width,Height,FormDesigner...), and
the size is bigger than the screen resolution, .NET will secretely
ignore or override your value with a value close to resolution of the
screen. This is creating many problems because I have a custom-drawn
Form which has a static size but needs to be scrollable at different
screen resolutions. Does anyone know a way around this, or why it
does this in the first place?
Another strange thing I noticed is that in form designer, If you set
AutoScroll to true it will secretly override IsMDIContainer and set it
to False, and vice versa. Can anyone verify this? And does this make
sense to anyone at all? Tag: MDI FORMS Tag: 59509
Databinding question
I have a user control that I drop to windows forms. I also
have typed dataset that is defined in the windows form
project. I want to bind the textboxes within the
usercontrol to a datatable field in this typed dataset.
I found the following old posting on this issue. But what
happens is, this property is not written to codebehind of
the form if it's set. So when I run the program it clears
the binding info. What do I have to do to make this work?
/*
Hello Colin,
You can export the DataBindings property of the child
control via property.
Since the DataBindings property is read only, you may need
to write some
code to handle set method of the property. This is a
sample code:
public System.Windows.Forms.ControlBindingsCollection
textBindings
{
set
{
System.Windows.Forms.ControlBindingsCollection bindings;
bindings =
(System.Windows.Forms.ControlBindingsCollection)value;
textBox1.DataBindings.Clear();
foreach(Binding b in bindings)
textBox1.DataBindings.Add(b);
}
get
{
return textBox1.DataBindings;
}
}
Hope it helps.
Best regards,
Lion Shi, MCSE, MCSD
Microsoft Support Engineer
This posting is provided "AS IS" with no warranties, and
confers no rights.
You assume all risk for your use. 2001 Microsoft
Corporation. All rights
reserved.
*/
Thanks Tag: MDI FORMS Tag: 59508
Zero-touch deployment and grids
I'm looking for a good grid control for Windows Forms. Seems easy,
right? Well, I've got a couple of requirements:
1. My app needs to run over zero-touch deployment without throwing a
SecurityException, and none of the third-party grids I've tried (Xceed
GridControl, ComponentOne C1FlexGrid and C1FlexGridClassic, and
DevExpress XtraGrid) can do this. (I understand the issues here -- just
try making a competitive, full-featured grid control without ever
overriding WndProc or using P/Invoke! -- but I can't use any of them for
this app as it's currently planned. Yes, I know about modifying
security policy, but if there are any alternatives I'd like to
investigate them first.)
2. I need to be able to put text into the row headers (similar to the
row numbers in Excel). This text needs to be a genuine row header,
i.e., non-editable and non-scrolling, always visible even if the user
scrolls to the right. (In other words, I need fixed columns in addition
to the fixed rows. If you've ever used the StringGrid or TMS grid for
Delphi, you'll know exactly what I mean.)
Requirement #2 seems to immediately disqualify the
Windows.Forms.DataGrid, unless someone can point me in the right
direction there. (In fact, it eliminates some of the third-party grids
too, which is sad. Too many datagrids, not enough *grids*.)
Ideally, I'd like a grid that also:
3. Doesn't have to use databinding at all, but instead fires an event
when it needs data for a cell (and fires another event when the user has
made edits that need to be saved). I can use databinding if I must, but
I'd rather have a proper owner-data grid. (AFAIK, I can't bind to
custom business objects, because I don't know at compile time how many
columns there will be.)
Does anyone know of any controls that would fit these criteria? This
app's needs (numeric editing, for the most part) are simple enough that
I could probably write my own grid if I had to, but I'm not sure my boss
wants me to spend that much time on it. <grin> Tag: MDI FORMS Tag: 59506
SOLUTION: smart client deploy webservice
Here's a way to dynamically set the URL of a webservice when you deploy a
smart client to a production environment.
Create the class below. Then add this code to the constructor of your WS
proxy:
ConfigWsUtil.ConfigWsUrl(this);
========================================================
using System;
using System.Reflection;
using Microsoft.Web.Services;
using System.Security.Policy;
namespace MyNamespace
{
public class ConfigWsUtil
{
public static void ConfigWsUrl(WebServicesClientProtocol service)
{
UriBuilder uriOld = new UriBuilder(service.Url);
UriBuilder uriNew = new
UriBuilder(Assembly.GetExecutingAssembly().CodeBase);
// if uri is http or https scheme, update the url of the webservice to
the new root path
if (String.Compare(uriNew.Scheme.Substring(0,4), "http", true) == 0)
{
uriOld.Scheme = uriNew.Scheme;
uriOld.Port = uriNew.Port;
uriOld.Host = uriNew.Host;
}
service.Url = uriOld.Uri.ToString();
}
}
}
======================================================== Tag: MDI FORMS Tag: 59505
Winform Application Architecture books / web pointers needed
Hi,
I am looking for book / web recommendations on writing
complex data-centric Winform Apps, preferably in C#.
By complex I mean apps that can't be brute-force created
by simply dragging and dropping datagrids, comboboxes and
SqlDataAdapters on a few forms in VS.Net 2003, because
there are simply too many forms, too many datasources and
because the application logic is complex.
I am not looking for a book on Hello, World, or how to
use / create the wincontrols or c# basics such as
delegates, classes and so forth.
I am looking for resources with information on:
- How to use design patterns specific to UI
workflow/orchestration
- How to make the app extensible.
- How to share responsibilities / data / flow control
between classes / components / controls.
For example, if I know I will need a ComboBox with a list
of countries in many forms, perhaps many times per form,
and that the countries data will also be needed in many
other parts of the application (perhaps in an sql join),
who should retrieve and own the country table? Main()? The
main form class? Another component? How should the
combobox get that information? Constructor? Property?
Event?
Another example. The main area of the main form represent
the main entity (e.g. Key account, contact, project).
The switch to the KeyAccount entity/winform control
implies the following: menu changes, status bar
changes, "Action panel" change, new tab control containing
many related grid lists (documents, appointments) and so
forth. Suppose also that these related grid lists should
be used by many main entities ( e.g. document list also
for projects, contacts, .)
Who is responsible for what? Where/how does one
class/component/control get adequate information (e.g.
KeyAccountID for related grid list, Actions for the Action
Panel)?
If you know of books/web resources which touch these
subjects, I would be very, very grateful. Thanks, Cedric. Tag: MDI FORMS Tag: 59503
No Response When Opening a .EXE Via HTTP
We have a 1.1 Windows Forms App deployed on our intranet
using no touch deployment. The strange thing is on some
machines nothing happens when the URL is invoked from IE.
(http://server/app1/app.exe say). On other machines it
works fine when invoked that way.
However, strangely running the URL using IEExec.exe always
runs the App. (ieexex http://server/app1/app.exe)
Any ideas as to why it does not run always on IE? Security
is not an issue since we granted FullTrust for the
StrongName of the EXE. Tag: MDI FORMS Tag: 59497
Print Dialog from Print Preview
How can I trap when the user clicks the print button(icon)
in the PrintPreviewDialog box, so I can display a
PrintDialog? I need to be able to display the dialog so
the user can select which printer to print to as well as
what page range to print. Tag: MDI FORMS Tag: 59496
Date not recognized - strange behaviour in DateTime.Parse
Dear Gurus,
I have a strange problem. Following code is working with no problems
on 10 different computers but only on one specific Win2K PC, it is not
working for a specific user ID. The problem is very strange. Look at
the code first:
DateTime myCreationDate;
object myDate = myOleDbReader.GetDateTime(myOleDbReader.GetOrdinal("CreationDateTime"));
if (myDate!=null)
{
myCreationDate = DateTime.Parse(myDate.ToString());
}
else
{
myCreationDate = DateTime.MinValue;
}
Now this code snippet gives me an Exception on "DateTime.Parse"
function that says "String was not recognized as a valid DateTime".
But it works on 10 of the 11 Computers and even on this 11th computer
it DOES work with all other user IDs except only one user. Everything
is same.
I did some research and found an interesting thing. The date value
stored in Database is "4/2/2003 6:10:00 PM". Now for all the working
users, the myReader.GetDateTime() function gives me the same string
and it parses correctly but on that one PC for that one user what I
get is "4/2/2003 18:10:00 PM" that gets an exception while parsing. I
don't know why it is showing 18 instead of 6 just for that one user on
this specific PC. Is there any setting that I need to check for this
user.
PS: This user is a network domain user and I checked with other domain
users, it works perfectly allright with other domain and local users.
Thanks in advance.
-Manoj Misran
mmisran@ekomcorp.com Tag: MDI FORMS Tag: 59492
Hi All!
Does anybody know how to collapse expanded windows to their original state?
(not layout)