|
Hi Infarkt!
Much appreciate for your advice.
I didn't notice that I've to assign it's binding context, that wasn't require in WinForms ComboBox.
Finally I solve the problem with following snippet.
Dim cb As ComboBox = DirectCast(tspcbxTest.Control, ComboBox)
With cb
.BindingContext = Me.BindingContext()
.FormattingEnabled = True
.DisplayMember = "Column_to_Dispaly"
.ValueMember = "ID"
'I declared new BindingSource so it doesn't relate to another control(s) with same BindingSource
Dim bs As New BindingSource(Me.Table1BindingSource, "")
.DataSource = bs
bs.Sort = "Column_to_sort_1,Column_to_sort_2,blah,blah"
Me.Table1TableAdapter.Fill(Me.DataSet1.Table1)
bs = Nothing
Thank you.
|
|
|
|
|
For a little WinForms application I'm working on, I have a grid of Buttons and I want to be able to press and hold the left mouse button and as the mouse is moved from Button to Button I want the Buttons it crosses to receive mouse events (kinda sorta like in MineSweeper). But I find that the Button I start on captures the mouse.
So far I have written a handler for the MouseCaptureChanged event that will set Capture to false if it has become true and it works pretty well.
private void
DeCapture
(
object sender
,
System.EventArgs e
)
{
System.Windows.Forms.Control temp = sender as System.Windows.Forms.Control ;
if ( ( temp != null ) && ( temp.Capture ) )
{
temp.Capture = false ;
}
return ;
}
However, it seems like I should be able to set the Button so that it won't capture the mouse in the first place; is there a way to do so?
|
|
|
|
|
I do not know of a property or method of button that will allow you to turn mouse capture off. Although obviously now that I have said that someone will come along and tell you about one!
Apart from the method that you are currently using, the only way I can think of is to use faux buttons on a panel or usercontrol with a GetButtonAt(x, y) method and do the drawing of pressed/unpressed state yourself in response to OnMouseMove, OnMouseDown, OnMouseUp etc.
There was (back in the VS2003 days) an MSDN Sample called ButtonArray Sample that did something similar.
There still is! Found it here[^].
Hope this helps.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Great, thanks, I downloaded it and I'll take a look.
|
|
|
|
|
Hi Guys,
I have an Installer object in a program, and i'd like to do some configuration to the installed files during the install process. In order to do this, i need the root directory of the installation, as specified when it prompts the user to enter the path of the install.
Is there any way to get this from inside the Installer? Or do i need to pass in a parameter or some kind of configuration setting?
Regards
Tris
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
Have a look here[^]"> and here.[^]"> Probably it would be best to use the Installer class.
Moim Hossain
R&D Project Manager
BlueCielo ECM Solutions BV
|
|
|
|
|
In the AfterInstall event of an Installer class you can get it from here...
System.Reflection.Assembly.GetExecutingAssembly().Location
|
|
|
|
|
Hi all,
This should be simple, but I can't figure it out.
How do I check if an mdi child is already open?
Here's what my app does
1. User clicks on button1, child1.show()
2. User clicks on button2, child2.show()
3. If user clicks on button1 again, I want to have a msgbox saying child1 is already open. But I need to check first if it is open or not.
How do I do this?
Thanks a lot!!
lyrithyforcambodia
lyrithyforcambodia
lyrithyforcambodialyrithyforcambodia
lyrithyforcambodia
lyrithyforcambodialyrithyforcambodia
lyrithyforcambodia
lyrithyforcambodialyrithyforcambodia
lyrithyforcambodia
lyrithyforcambodialyrithyforcambodia
lyrithyforcambodia
lyrithyforcambodialyrithyforcambodia
lyrithyforcambodia
lyrithyforcambodialyrithyforcambodia
lyrithyforcambodia
lyrithyforcambodialyrithyforcambodia
lyrithyforcambodia
lyrithyforcambodialyrithyforcambodia
lyrithyforcambo.
|
|
|
|
|
Check the MDIParent's MdiChildren property.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
How about something very simple, like setting a flag when you create an instance of the child form and show it? Then you code can just check that flag to see if the form is already open. When the form closes, reset the flag.
|
|
|
|
|
I suspect you're trying to ensure that you don't open multiple instances of the same mdi form i.e. you want to check if an instance is open and if it is not, you open it otherwise you show the already existing instance. If that is that case, lookup singletons
e.g http://msdn.microsoft.com/en-us/library/ms998558.aspx[^]
|
|
|
|
|
And why are you telling me this?? Try replying to the original poster next time and not someone else giving an answer. That way, he gets the email that says you replied to him. Right now, he doesn't know you replied at all.
|
|
|
|
|
No need to go ballistic. Twas just a mistake. I intended to reply to the original posting. Do you usually go off on simple things like that? Take a pill and chill!
|
|
|
|
|
If you think that was me going off on you, you haven't been around here long enough.
|
|
|
|
|
Example of two buttonclicks in the MDIParent:
private void button1_Click(object sender, EventArgs e)
{
bool open = true;
foreach (Form frm in MdiChildren)
if (frm.GetType() == typeof(Form1)) open = false;
if (open)
{
Form1 frmOne = new Form1();
frmOne.MdiParent = this;
frmOne.Show();
}
else
MessageBox.Show("Form1 is already open");
}
private void button2_Click(object sender, EventArgs e)
{
bool open = true;
foreach (Form frm in MdiChildren)
if (frm.GetType() == typeof(Form2)) open = false;
if (open)
{
Form2 frmTwo = new Form2();
frmTwo.MdiParent = this;
frmTwo.Show();
}
else
MessageBox.Show("Form2 is already open");
}
|
|
|
|
|
I want to assign a stored procedure for an sql datasource. The stored procedure belongs to different user-defined schema rather than the dbo. The stored procedure is being detected but but when I click test it says "Could not find stored procedure 'sp_name'".
|
|
|
|
|
Hey dude, are you aware you posted this in the .NET framework forum? Seems like it should be in one of the Database forums yes?
|
|
|
|
|
First i ve created .xsd file and then add to my project. After that add a crystal report. I am not getting any table in the Database field of the crystal Report and getting error "The Report has no Tables"
<pre> Public Sub sPrintProjectExpenseReport(ByVal Print As Boolean, Optional ByVal findstring As String = "")
Dim ObjDataAdapter As SqlDataAdapter
Dim ObjDataset As DataSet
Dim sql As String
Try
sql= "Select * from project"
ObjDataAdapter = New SqlDataAdapter(sql, ObjCon)
ObjDataset = New DataSet()
ObjDataAdapter.Fill(ObjDataset, "ProjectwiseExpenseReport")
''''export xsd
'ObjDataset.WriteXmlSchema(Application.StartupPath & "\ProjectwiseExpenseReport.xsd")
'MsgBox("Report Exported")
Dim ObjReport As New CRProjectwiseExpense
ObjReport.SetDataSource(ObjDataset.Tables("ProjectwiseExpenseReport")) '' error is here
If Print Then
ObjReport.PrintToPrinter(1, False, 0, 0)
Else
FrmCRViewer.ObjReportViewer.ReportSource = ObjReport
FrmCRViewer.Show()
End If
Catch ex As Exception
MsgBox(Err.Description, MsgBoxStyle.Critical)
End Try
End Sub
|
|
|
|
|
First assign the report like generate report by Datasource
then
Set all the data source by programmatic
it will start work
|
|
|
|
|
plz give a sample. how does this action should be done!!!
i can't get you.
sorry
|
|
|
|
|
is it possible ?
1)can i force stop CLR from doing something? whenever i need.
2) can i force to start clr to work?whenever i need
some one asked me the Question, plz don't tell what does clr do....
|
|
|
|
|
No, you cannot stop the .NET framework. This would even be dangerous, as it would halt the execution of all applications that are using the framework.
Can you tell us what you're trying to achieve? Perhaps there's an alternative method to reach that goal. If the target is a Windows Service, then yes - those can be paused, started and stopped.
I are troll
|
|
|
|
|
I'm trying to get the latest installed version of .Net on a given machine. I've tried a couple of different ways, but it keeps coming back with 2.0, which is curious since I'm running a WPF app on a machine that I *KNOW* has 3.5 SP1 on it.
How should I go about properly retrieving the .Net version?
What happens if a .Net app is run on a system that doesn't have the appropriate version of .Net?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
This registry key seems to have all the infor required - on this system anyway.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Davey's reply covers the first part of your question. More info about the entire detection process could be found here.
As for what happens, in general the program will crash on startup, normally with an incredibly useless message. If you have 2.0 and need 3.0 or 3.5 then it will sometimes crash saying it could not find PresentationFramework.dll or whatever WPF one it is looking for.
|
|
|
|