|
Start here[^], it contains everything you need to get you started for development on Windows
I are troll
|
|
|
|
|
Hi,
i want to display greek characters in text box.
Thanks in advance
|
|
|
|
|
Hi All,
Am facing an unusual issue with some bitmaps that i`m loading dynamically.
The situation is that i`ve got a button on which I draw a bitmap dynamically
depending on whether the mouse has hovered over it, if it was previously clicked etc...
A tooltip is associated with this button and has ShowAlways = true. I also
set ToolTpActive = false and then true due to this fix suggested for a framework bug
(as given at
http://209.85.229.132/search?q=cache:nj6GSkFDwuIJ:stackoverflow.com/questions/559707/c-tooltip-will-not-re-appear-after-first-use+tooltip%2Bbug%2Bactive%2Bc%23&cd=3&hl=en&ct=clnk&gl=in
)
Now the issue is that sometimes when i`m working with other applications the bitmaps get
laoded partially and are clipped from the top (maybe upper 25% of it). My button size is the same
and i debugged to see if the bitmap gets loaded correctly, and it does.
I`ve seen this happening only with buttons that have a tooltip, and this button class is
used in 3 separate processes (running simult.) and all of them get clipped one after another.
I tried to comment out the SetToolTipText and ShowAlways parts of the code but it still occurs.
Has anyone come across such an issue earlier, that too happening across processes ?
Any help is most appreciated.
Thanks in advance.
|
|
|
|
|
Can anyone help with this issue? I normaly create an instance of a windows form with the following type of code:
private void btnAddPub_Click(object sender, EventArgs e)
{
AddPubForm newForm = new AddPubForm();
newForm.ShowDialog();
}
It has been working fine until I added a third windows form to my project. Now I can't get the telesense that allows you to get that class, so I'm assumming the program doesn't see this form.
I'm using a tabcontrol with three tab pages in my mainform, could that be the problem?
Could it have anything to do with tabindexes?
Thank you in advance
RAHEEM
|
|
|
|
|
Raheem Thaele wrote: I'm using a tabcontrol with three tab pages in my mainform, could that be the problem?
No
Raheem Thaele wrote: Could it have anything to do with tabindexes
No
Check the namespaces and the also the name of the class. Check for access modifier(private/public etc) as well.
|
|
|
|
|
d@nish I see what you are saying, I use modifiers, but in this case as soon as I try to run my code to create an instance of a third form from within the same form it doesn't see the third one and thus unable to show the dialog. Do you think it might also have a limit to the amount of form that can be created from a single form?
I've tried to google this on it's a bit tricky. Could this be a flaw in Visual Studio?
|
|
|
|
|
What are the namespaces for both the forms? Are they same? If not then you will have to give fully qualified name.
If you are using VS2008, then type in the name of the form class(in correct case), right click and select resolve.
|
|
|
|
|
The namespaces are the same. I'm using VS2005. I also thought the problem might also be the IsMdiContainer Form property, but is see that it can't be the case since I'm using newForm.ShowDialog() method not newForm.Show() method, so the form that is showing has to close so that I display other forms besides the main form.
I really appreciate the help, I'm still stuck though. Any ideas what I might try?
|
|
|
|
|
I have three different forms that I create instances of from a main form. The first two forms show, but the third one you can't even see the telesense and the main form class cannot see it.
Could there be a limit to the ammount of form classed you can call from a form class?
|
|
|
|
|
Raheem Thaele wrote: Could there be a limit to the ammount of form classed you can call from a form class?
Quote Selected Text
Yes, but it is way, way more than three.
BTW: It is intellisense, not telesense or tellysense.
When you build your solution, does the 'missing' form compile? If it doesn't it will not show up in intellisense.
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.”
|
|
|
|
|
hi, everybody! what's the difference between hInstance on WNDCLASS and
hInstance on CreateWindow;
|
|
|
|
|
Read the documentation and if you still don't understand explain why in terms of the documentation.
WNDCLASS[^]
CreateWindowEx[^]
|
|
|
|
|
can you give me a example to explain!thanks!
|
|
|
|
|
iceman8616 wrote: can you give me a example
What? I did, those are two links in my last reply, you just have to click them.
|
|
|
|
|
[Edit #1] This is an open issue for VS 2010 on MSDN[^]. I have added to the bug report on "RowSpan" not being exposed a comment that Cell, Row, Column, and ColumnSpan properties are also not exposed at design-time.
[/Edit 1]
This MSDN article targeting VS 2010 and Framework 4.0[^] implies the RowSpan and ColumnSpan of a selected Control inside a TableLayoutPanel will expose RowSpan and ColumnSpan properties at Design Time : (note the same feature supposedly existed in FrameWork 3.5) :
"Spanning Rows and Columns with a Control
The TableLayoutPanel control adds several new properties to controls at design time. Two of these properties are RowSpan and ColumnSpan. You can use these properties to make a control span more than one row or column.
To span rows and columns with a control
1.Select the Button control in the first row and first column.
2.In the Properties windows, change the value of the ColumnSpan property to 2. Note that the Button control fills the first column and the second column. Also note than an extra row has been added to accommodate this change.
3.Repeat step 2 for the RowSpan property."
You can of course set the RowSpan and ColumnSpan properties in code, for example, like this :
private void button3_Click(object sender, EventArgs e)
{
tableLayoutPanel1.SetColumnSpan(button3, 2);
button3.Anchor = AnchorStyles.Left | AnchorStyles.Right;
}
Here : when button3 is clicked its ColumnSpan is set to the width of two rows of the TableLayoutPanel. What happens at run-time is, of course, going to be affected by the control's Dock and Anchor proporties : i.e., if button3 is anchored left and right it will, at run-time change its width to span the two rows; if button3 is only anchored left, it will be centered betweeen the two rows, but its size will not change.
I assume this is a glitch of VS 2010 ? I do not have a working machine with VS 2008 and FrameWork 3.5 to test against.
best, Bill
"Many : not conversant with mathematical studies, imagine that because it [the Analytical Engine] is to give results in numerical notation, its processes must consequently be arithmetical, numerical, rather than algebraical and analytical. This is an error. The engine can arrange and combine numerical quantities as if they were letters or any other general symbols; and it fact it might bring out its results in algebraical notation, were provisions made accordingly." Ada, Countess Lovelace, 1844
modified on Monday, June 22, 2009 2:25 AM
|
|
|
|
|
My 3.5 VS2008 SP1 environment exposes those properties for a textbox control that I drop into a TableLayoutPanel cell.
I think that is what you were asking.
|
|
|
|
|
I've been pulling my hair out over this for the past week. I finally got the query to work perfectly last night in MS SQL management studio, but when I tried to build it into my VS2008 application it has failed miserable. All day long. For the last 12 hours I've been fighting to make this standard T-SQL syntax work in VS. Here is the code:
SELECT NAME, TIME, AGE,
ROW_NUMBER( ) OVER (ORDER BY TIME) AS RANKING
FROM 'SampleFile.txt'
WHERE AGE<16
UNION
SELECT NAME, TIME, AGE,
ROW_NUMBER( ) OVER (ORDER BY TIME) AS RANKING
FROM 'SampleFile.txt'
WHERE AGE
BETWEEN 16 AND 29
UNION
SELECT NAME, TIME, AGE,
ROW_NUMBER( ) OVER (ORDER BY TIME) AS RANKING
FROM 'SampleFile.txt'
WHERE AGE>29
ORDER BY TIME
What I inevitably get back from the TableAdapter Configuration Wizard is:
Error in SELECT clause: expression near ','.
Missing FROM clause;
Unable to parse query text.
When I click to finish anyway and run the solution I get "OdbcException was unhandled"
ERROR [42000] [ODBC Text Driver] Syntax error (missing operator) in query expression
'ROW_NUMBER () OVER(ORDER BY TIME)'
I have tried every combination of parenthesis, quotes, etc. Nothing has worked.
BTW, I'm using the ODBC text driver, don't know if that makes a difference.
Please help.
Sincerely,
Andrew
|
|
|
|
|
Your error messsage says that your using an ODBC Text Driver in your connection string, which will not in any way shape or form work with SQL Server. Post the code that's throwing the error, and your connection string.
|
|
|
|
|
I'm sorry if I spoke without precision - the query I posted worked when I tried it with SQL management studio, run against a sample database. The error shown was thrown when I wrote that exact query code into the DataTable Adaptor in Visual Studio 2008 as a query to the ODBC Text Driver Connected text file. "DSN = SampleFile.txt" is the connection string. I could post the whole path, but it would be meaningless, as it is specific to my machine.
My complete effort is detailed here:
Copy the text to a file called "SampleFile.txt" in a selected directory.
Edit the schema.ini file of that directory as follows:
[samplefile.txt]
ColNameHeader=False
Format=FixedLength
MaxScanRows=25
CharacterSet=OEM
Col1=NAME Char Width 8
Col2=TIME Integer Width 8
Col3=AGE Integer Width 8
Under the Data Sources (ODBC) section of the administrative tools file in control panel, set
"SampleFile.txt" to be a Microsoft Text Driver (*.txt; *.csv) System Data Source.
In Visual Studio 2008 create a new project using the windows application template.
Place a datagridview in the form.
Create a Data table, using the following SQL query:
SELECT NAME, TIME, AGE,
ROW_NUMBER() OVER(ORDER BY TIME) As Rank
FROM 'SampleFile.txt'
WHERE AGE < 16
UNION
SELECT NAME, TIME, AGE,
ROW_NUMBER() OVER(ORDER BY TIME) As Rank
FROM 'SampleFile.txt'
WHERE AGE BETWEEN 16 AND 29
UNION
SELECT NAME, TIME, AGE,
ROW_NUMBER() OVER(ORDER BY TIME) As Rank
FROM 'SampleFile.txt'
WHERE AGE > 29
ORDER BY TIME
Here is where it failed. I'm trying to rank 3 age group result sets and then output all three into one datagridview.
I was using the approach wherein I wrote 3 queries into 3 datatables, created a column I called ranking and then set it to auto-increment, seed=1, step=1, but then I couldn't get the 3 resulting datatables to bind back to the 1 datagridview, so I've been battling with this one query linked with the UNION clause.
Thanks for your help,
Andrew
|
|
|
|
|
Well, it doesn't work because the Text Driver doesn't support full SQL. It supports a small subset of SQL only and, of course, no UNIONs.
|
|
|
|
|
No, that's wrong. UNION works fine, it's the ROW_NUMBER function that isn't working. That's why I'm appealing to the greater developer community - to find a work around. I thought maybe a "Microsoft MVP" might be able to help.
|
|
|
|
|
Your only work around that I can think of would be to load the data into a DataTable or other contain and use LINQ to get the results.
|
|
|
|
|
I figured it out. I had to use the archaic SQL 2000 "COUNT" syntax to achieve the rank functionality. Thanks for your response though.
|
|
|
|
|
Hello there!
My code is highlighted below.I have five tabpages(two is shown here!) on a form called vwpatient that runs each time a tabpage is selected.The code below works but my problem is this: there is a textbox called sachPatient.patID from another form called sachPatient, the code pulls data from the database on clicking one or two pages, but if more than two is clicked, an exception fires saying "Make sure you have not released a resource before attempting to use it". I have tried endlessly to fix this problem to no avail. And am still trying!!.
I would appreciate if someone can help me.
Thanks in advance!!!
Private Sub TabControl1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TabControl1.SelectedIndexChanged
For Each tabcont As Control In Me.Controls
If TypeOf tabcont Is TabControl Then
For Each tp As Control In tabcont.Controls
If TypeOf tp Is TabPage Then
Select Case tp.Name
Case "vwProfTabPg"
Try
LoadData()
' Configure and execute the command.
cmd = New System.Data.SqlClient.SqlCommand("SELECT * FROM Patient_profile where patient_Id = @Pat_ID")
cmd.Connection = cn
Dim paraPatId As SqlParameter = cmd.Parameters.Add("@Pat_ID", sachPatient.patID.Text)
' Load the DataTable.
datadapt = New System.Data.SqlClient.SqlDataAdapter(cmd)
datadapt.Fill(ds)
ds.Tables.Add(dt)
' Bind the DataGrid.
vwProfDG.DataSource = ds.Tables(0)
vwProfDG.Visible = True
Catch ex As SqlException
MsgBox(ex.Message.ToString())
Finally
cn.Close()
End Try
Case "vwLabTabPg"
Try
LoadData()
' Configure and execute the command.
cmd = New System.Data.SqlClient.SqlCommand("SELECT * FROM lab where patient_Id = @PatLa_ID")
cmd.Connection = cn
Dim paraPatId As SqlParameter = cmd.Parameters.Add("@PatLa_ID", sachPatient.patID.Text)
' Load the DataTable.
datadapt = New System.Data.SqlClient.SqlDataAdapter(cmd)
datadapt.Fill(ds)
ds.Tables.Add(dt)
' Bind the DataGrid.
vwLabDatGrid.DataSource = ds.Tables(0)
vwLabDatGrid.Visible = True
Catch ex As SqlException
MsgBox(ex.Message.ToString())
Finally
cn.Close()
End Try
End Select
End If
Next
End If
Next
|
|
|
|
|
Hi,
< PIV 2.8 mhz, Win XP SP3, VS 2010, 2Gigs of Ram >
I notice a "one time cost" (on the order of 10 seconds) at a WinForm's application startup where the PropertyGrid control is not responsive to any selection of properties.
I assume this is because the PropertyGrid is using reflection to enumerate all the current controls on the Form, and recursively iterating on any Container controls which have some Controls inside them.
Just wondered if anyone else had experienced this, and had observed a delay, or has another hypothesis about the delay.
thanks, Bill
"Many : not conversant with mathematical studies, imagine that because it [the Analytical Engine] is to give results in numerical notation, its processes must consequently be arithmetical, numerical, rather than algebraical and analytical. This is an error. The engine can arrange and combine numerical quantities as if they were letters or any other general symbols; and it fact it might bring out its results in algebraical notation, were provisions made accordingly." Ada, Countess Lovelace, 1844
|
|
|
|
|