|
This is quite strange. I deleted and recreated the TextBox in question, with exactly the same configuration, and the problem disappeared.
|
|
|
|
|
See that come from holding your tongue correctly when adding the textbox. Peice of cake.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
i have one dataset that contains 2 tables
table 1 is{1,2,3}
table 2 is {4,3}
i want to display in a form the following
[1,2,4]
how could i join the 2 tables
and when i press the next button the records in both tables must
move to the next record
please help me with this
|
|
|
|
|
ashrafhakami wrote: how could i join the 2 tables
Hard to say, based on this. Is there a column in common you can use to do a join ? If not, how do you know which 4 goes with which 1 and 2 ? Is 3 a column in common you can join on ?
ashrafhakami wrote: and when i press the next button the records in both tables must
move to the next record
If you get the SQL right you will have one table with the two lots of data merged.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
thanx for your passin by Christian Graus
i will explain more
in table one there are three columns which are
{ drug_name,drug_no,type_no}
in the second table
{ type, type_no}
in the form i need to display the following
drug_name:for example viagra
drug_no:4
type:tablet
when i move to the next record the type must change according to the drug_name and drug_no
for example the next record in the table one is
{Banadol,5,2}
and the second table is
{syrup,2}
i want to display in the form the followin
drug_name:Banadol
drug_np:2
type:syrup.
i did in my cod the followin
in the form_load the followin
for the first table where con is the connection oledb
dim sql as string="select * from drug"
cmd.connection= con.....
cmd.commandtext= sql
dataAdapter.fill(dataset,"drug")
txdrug_name.databindings.add("text",dataset,"drug.drug_name")
txdrug_no.databindings.add("text",dataset,"drug.drug_no")
and the second table is
dim sql2 as string="select type from type where type_no=1 "
cmd.connection= con.....
cmd.commandtext= sql2
dataAdapter2.fill(dataset,"type")
txdrug_type.databindings.add("text",dataset,"type.type")
and every thing was ok when displayed
but when i move to the next record the type never chang
even if i changed the sql (="select type from type where type_no=1 "
)
i even tried to assgin the type _no for table one to a variable to be like this ="select type from type where type_no=variable "
but i failed
please help me it is the a cadimic project
|
|
|
|
|
What you need is a single query:
select drug_name,drug_no, type
from table1 t1 inner join table2 t2 on t2.type_no = t1.type_no
where table1 is the drug_name/number tabler and table2 is the type_no/type table
and then
dim sql as string="{as shown above}"
cmd.connection= con.....
cmd.commandtext= sql
dataAdapter.fill(dataset,"drug")
txdrug_name.databindings.add("text",dataset,"drug.drug_name")
txdrug_no.databindings.add("text",dataset,"drug.drug_no")
txdrug_type.databindings.add("text",dataset,"drug.type")
Its called a table join. I suggest yuo try reading up on sql, otherwise your application is really going to suffer.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I would like to know how to use a progress bar to keep track of video during playback, does anyone know how or can point me to the right direction?
|
|
|
|
|
I suspect you will run into the infernal problem of the display not updating as your UI thread will be busy running the video, but you could try running a normal progress bar maybe updated by a timer started and stopped from the play/pause/stop events of your video player control.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
If your video control has a position property, you can set a timer and set the bar based on that, so it never goes out of sync
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi All,
I would like to create a module that manages ZOrders of windows in a system so that a particular group of windows (as identified by their Captions or Window Classes) are always together in zorder.
This means no external apps (like notepad or Task Manager) should "interfere" with them. So far the approaches i`ve tried are :
1. Using Windows CBT Hooks to get Activation notifications for all windows in the system. Then based on which windows is being activated i do zorder management
2. Use the SetWinEvent Hook API , so whenever Foreground window changes i do my zorder management. But this is done "after" the foreground change has occured so to bypass it i use AttachThreadInput on the current foreground window, set my app window as the new Foreground window and then detach.
Issue is ZOrder cant be maintained reliably and this sometimes causes my apps to hang.
3. Make all my app windows as Owned Windows of a single Owner window, but with this the internal ZOrder gets messed up if i show/hide my app windows. Is there any extra step i should take internally in my app windows, or issue some Messages form my Owner window before showing/activating any apps ?
4. A general question was : If I give SetWindowPos with the handle of a hidden window, or specify it as the hWndAfter parameter , what effect will this have on the ZOrder ?
All my windows are TopLevel, Non-TopMost windows and they can create their own custom MessageBox and Dialogs (TopMost , Non-Topmost). So whatever mechanism i go with should be extensible to these message boxes too.
Are there any other ways to this task ? Something better or faster ?
I`ll be happy to provide more details if required.
Any help and suggestions are most welcome.
Thanks in advance.
|
|
|
|
|
HI,
I am getting the above msg when I try & close a MDI Child form in its form load method, as there is no data to display from SQL, so I catch the error, as below:-
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Sorry there has been an error" );
this.Close();
}
The message appears when it trys to close the form - has anyone any idea's.
The child form is opened from the MDI form as so:-
FrmUserList frmUserList = new FrmUserList(_isLiveConnection);
frmUserList.MdiParent = this;
frmUserList.Show();
Lady Programmers are a rare breed!
|
|
|
|
|
I have a collection of business objects bound to a DataGridView, and I would like changes made to my BO's through the grid to be persisted as they happen, or as close as possible to as they happen. I think a per row basis is fine, so which is the best event to handle in which to request that changes are persisted? At the moment I'm using RowValidated, so whenever a row is changed, it persists. Should I continue using this event?
|
|
|
|
|
|
Thanks Mike. I already implement IPropertyChanged, and my grid handles it nicely, but I want the grid to signal an object that a whole object, i.e. row, commit from the UI to the model, is mandated, much like editing records in Access. Until the user moves off a row, the grid should be able to restore the original values for that row.
|
|
|
|
|
Brady Kelly wrote: Until the user moves off a row, the grid should be able to restore the original values for that row.
Don't you need an Undo implementation for that. I mean your objects are bound right? So the original values are gone on a Cell by Cell basis right?
led mike
|
|
|
|
|
I'm looking in the LINQ to SQL DataContext neighbourhood for something that might help me there.
|
|
|
|
|
hi guys,
i am trying to upload a mp3 file from local disk to a remote server using FtpWebrequest. Everything went fine and the file is getting uploaded onto the remote server, but when i try to play that the file has no content in that, i got to a conclusion that it is not encoded properly during upload and here's where i request for someone's help as i dnt know how to encode a mp3 file while uploading
here is my code pls go thru and if you know where the prob is pls do suggest me.
Dim hostname As String = "ftp://ftp.domain.com/folder/"<br />
<br />
Dim fileName As String = path.Substring(path.LastIndexOf("\") + 1)<br />
Dim objMp3Info As New Monotic.Multimedia.MP3.MP3Info<br />
objMp3Info.Filename = path<br />
<br />
Dim username As String = "username"<br />
Dim password As String = "password"<br />
<br />
<br />
Dim request As FtpWebRequest = DirectCast(WebRequest.Create(hostname + "/" + fileName), FtpWebRequest)<br />
request.UseBinary = True<br />
request.Method = WebRequestMethods.Ftp.UploadFile<br />
<br />
request.Credentials = New NetworkCredential("username", "password")<br />
Dim sourceStream As New StreamReader(path)<br />
<br />
Dim fileContents As Byte() = Encoding.UTF8.GetBytes(sourceStream.ReadToEnd()) ----- this is where i need someones help<br />
sourceStream.Close()<br />
<br />
request.ContentLength = fileContents.Length<br />
<br />
Dim requestStream As Stream = request.GetRequestStream()<br />
requestStream.Write(fileContents, 0, fileContents.Length)<br />
<br />
requestStream.Close()<br />
<br />
Dim response As FtpWebResponse = DirectCast(request.GetResponse(), FtpWebResponse)<br />
MessageBox.Show("File Uploaded Sucessfully, status {0}", response.StatusDescription)
Thanks in advance...
Regards
Srinivas
|
|
|
|
|
Hello,
I am presently creating a list box control for our custom gui application using C# .
The dll is compiled using 1.1 compact framework SDK and is run on windows XP/CE embedded..
The new list box control has to be modified to use custom graphics.. the requirement right now is to replace the windows standard scroll box with the custom images provided..however since we are using compact SDK many of the properties related to the scroll box are not available. Does anyone have an idea a work around .
Regards
Vivian Neil Fernandes
|
|
|
|
|
How do I achieve the DropDown drop-down style in a combobox column in a DataGridView? I can't find any setting, but I would like to, e.g. on entering invoice lines, be able to either enter a product code or select one from a list.
|
|
|
|
|
Hi,
DataGridView gives us the ComboBox column type to attach a dropdown box in a column. Below is the code snippets for the same:
BEGIN CODE
DataGridViewComboBoxColumn colGender = new
DataGridViewComboBoxColumn();
// Size the column width so it is wide enough to display the
header
colGender.AutoSizeMode =
DataGridViewAutoSizeColumnMode.ColumnHeader;
colGender.DataPropertyName = "Gender";
// Specifiy the list of choices in the combo box
colGender.Items.AddRange(new string[] { "M", "F" });
// Sort the combo box contents alphabetically
colGender.Sorted = true;
// Disable sorting for the column
colGender.SortMode = DataGridViewColumnSortMode.NotSortable;
colGender.HeaderText = "Gender";
colGender.Name = "Gender";
colGender.ReadOnly = false;
dataGridView2.Columns.Add(colGender);
//
// Column: Marital status, combo box
//
// For this column, combo box contents are retrieved from the
database
DataGridViewComboBoxColumn colMaritalStatus = new
DataGridViewComboBoxColumn();
// Size the column width so it is wide enough to display the
header
colMaritalStatus.AutoSizeMode =
DataGridViewAutoSizeColumnMode.ColumnHeader;
colMaritalStatus.DataPropertyName = "MaritalStatus";
// Retrieve the list of choices from the database
colMaritalStatus.DataSource =
dataSetAdventureWorks.Tables["MaritalStatusChoices"];
// Identify the column in the Employee table that is used to
select the combo box item
colMaritalStatus.ValueMember = "MaritalStatus";
// If the column value is not human friendly, e.g., a foreign
key identity off to a related table,
// the DisplayMember property is used to identify the column
used for display purposes
colMaritalStatus.DisplayMember = "MaritalStatus";
colMaritalStatus.HeaderText = "Marital Status";
colMaritalStatus.Name = "MaritalStatus";
colMaritalStatus.ReadOnly = false;
dataGridView2.Columns.Add(colMaritalStatus);
END CODE
Hope this helps
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
Hi, all of you exeperts here..
I have one simple question, how to i open a windows form one project in other windows application project ??
I have 2 projects in one solution, and i added a refrence to my main windows application project, so i can see all the forms in other project.
Dim NewForm as windowsapp1.form1
NewForm = new windowsapp1.form1
NewForm.Show
Is there anyway to bypass this code, and open a form directly without declaring a new form and then open it.
Tnx in advance for your posts.
|
|
|
|
|
Please don't cross post. This is probably where this question belonged, but truth is, not many people post here. Either way, choose one forum for your post.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I did find a way to do it using system.reflection.
Private Sub OpenFormFromAssembly(ByVal FormName As String)
Dim MyAssembly As Reflection.Assembly = Reflection.Assembly.LoadFile(" Assembly to load ")
Dim MyTypes As Type() = MyAssembly.GetTypes
For Each mType As Type In MyTypes
If mType.BaseType Is GetType(Form) Then
If mType.Name = formName Then
Dim o As Object = Activator.CreateInstance(mType)
Dim f As Form = CType(o, Form)
f.Show()
End If
End If
Next
End Sub
No need to declare a new form evry time you need to open it.
Tnx for your help.
|
|
|
|
|
Hi...,
I want to write a zoom function for a PictureBox. Therefore I have to change some values (Left, Top, Width, and Height) of the PictureBox. The PictureBox is redrawn, when I just change one of theses values. So, when I change all 4 values the PictureBox gets flickering and jumping around.
How to stop/activate the Redrawing of a PictureBox.
This is my code:
private void CalcPictureBox1()
{
int zoomedWidth = (int)(bitmapDepthBuffer.Width * pBoxZoomFactor);
int zoomedHeight = (int)(bitmapDepthBuffer.Height * pBoxZoomFactor);
if (zoomedWidth > panelDepthBuffer.Width)
{
this.pBoxDepthBuffer.Left = 0;
}
else
{
this.pBoxDepthBuffer.Left = (panelDepthBuffer.Width - zoomedWidth) / 2;
}
if (zoomedHeight > panelDepthBuffer.Height)
{
this.pBoxDepthBuffer.Top = 0;
}
else
{
this.pBoxDepthBuffer.Top = (panelDepthBuffer.Height - zoomedHeight) / 2;
}
this.pBoxDepthBuffer.Width = zoomedWidth;
this.pBoxDepthBuffer.Height = zoomedHeight;
}
Thank you in advance,
Michael
modified on Friday, June 20, 2008 4:33 PM
|
|
|
|
|
To update position and size at the same time, you can use...
.SetBounds(left, top, width, height); [also: .Scale may be of use]
Hope this helps.
Matthew Butler
|
|
|
|
|