|
Steve Sorry...
The problem is that i am from croatia and its hard to me to explain it on english wery good... I am trying buth its not easy...
Well...
My problem is that i want that the listbox shows when i press key"<" buth i want that it shows on the possition where was i typing where was the cursor buth not the mouse cursor, typing cursor(IBeam).
I did make it like this...
When key "<" is pressed if
listbox1.visible=true then<br />
listbox1.visible=false <br />
elseif listbox1.visible=false then<br />
listbox1.visible=true
buth the problem is that it is allways on possition where i place it in design.
i want that his possition is where i have typing... Like in dreamweaver when u typing tags...
Did i explain it good now?
<blink>FeRtoll Software.net
------------
E-Mail me
WebPage
|
|
|
|
|
Perhaps you should read the documentation on the RichTextBox more, RichTextBox.GetPositionFromCharIndex[^].
This will return the position of any character, relative to the top-left corner of the RTB window. You'll have to do a little math to get the position of where you should position your listbox relative to the top-left corner of the Form.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi All,
I have posted this like hundred times and i seem to get no response from any. i am again refining my question hope that makes clear.
I have a data repeater in my webpage. which basically queries 3 tables and combines and repeats accordingly. but what i have in one table is a statatistical data like
id estimated actual year
1 20 18 2003-2004
1 23 21 2003-2004
1 24 14 2005-2006
2 20 24 2003-2004
2 15 29 2003-2004
2 16 14 2004-2005
3
4
7
etc.
missing IDs are present in other TABLES just not in statistical table.
i need to create individual chart for id 1 for year 2003-2004 and year 2005-2006 and so on for id 2 and so forth.
i can create once chart based upon a single table but its like a quering a table and based upon parameter i need to create new dataset and bind it to some web chart control.
the data should be presented something like this in a repeater.
Head information related to ID 1 from table 1
sub head description related to ID 1 from table 2
a chart for ID 1 of year 2003-2004 and a chart for ID 1 of year 2005-2005
(if no data present dont display chart)
so on for other IDs.
Please help how to achieve this or do you know any Software that does this so that i can simply purchase this software.
thanks
Robin
robin
|
|
|
|
|
Did u checked the date format?
FeRtoll Software.net
--------------------
I fertoll@net.hr I
--------------------
|
|
|
|
|
what do you mean by date?
you mean data. yeah i did check data format whats your point sir?
robin
|
|
|
|
|
|
it has nothing to do with date format. basically 2003-2004 is what users will enter and its like standard format. i just want to plot graph betwn actual vs estimated and with the year string.
hope i am not confusing you
|
|
|
|
|
|
frmlogin has txtusername.text and txtpassword.text. I would like to take the text that is put into the txtusername.text and send it over to form2 once I hide frmlogin and show form2. I have tried this and failed.
Public user as string
user = txtusername.text
This does not work when I try to put user into form2. So how would I go about this?
Thank You
-- modified at 18:26 Monday 6th March, 2006
|
|
|
|
|
Form1 contains:
-txtusername
-txtpass
Form2 contains:
-lblUser
-lblPass
When closeing form1...
Dim fr as new Form2
fr.lblUser.text=txtusername.text
fr.lblPass.text=txtusername.text
fr.showdialog
and on Form2 make that labels invisible... Thats all... :->
FeRtoll Software.net
--------------------
I fertoll@net.hr I
--------------------
|
|
|
|
|
The easy way is to create a public variable on Form2 and pass the txtusername.text to that variable
Insert on the top of the class of Form2
Public UserName as String
In the frmLogin:
Dim SecondForm as new form2
SecondForm.UserName=txtusername.text
SecondForm.show
me.hide
You can also use a property but...
Hope it helps
|
|
|
|
|
Hi
You can do this in many ways. I will suggest 2 ways.
1.
Create property on form2... (Say User) and set that property after initialize form2 class.
Set the property value to label on it in the form_load
Sample code written on VB 2005
Public Class Form2
'Use property for this
Public user As String
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Label1.Text = user
End Sub
End Class
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim f2 As Form2 = New Form2()
f2.user = Me.txtLogin.Text
f2.ShowDialog()
End Sub
End Class
2.
Create constructor in Form2 in order to pass string (Public sub New (user as string))
And pass textbox value then you initialize Form2.
Set the passed value to label on it in the form_load
No sample code .. (i didnot check this should be work)
Try those. Guaranteed to work well
Regards,
chandana
|
|
|
|
|
On form2 I have set Public username as String.
On frmlogin this is the code for the ok button when you type in the username and passwoed.
If txtpassword.text = frmlogin.tag Then
Dim secondforum As New Form2
secondform.username = txtusername.text
secondform.show
me.hide
Else
msgbox "Try Again"
End If
On form2 under Forum Load I have form2.caption = username
For some reason the username does not go over to form2. I tried to use F8 to see if the username was being seen in Public username as String but for some reason when in F8 mode it won't skip over to the second form code so I can hover over it with mouse and check.
*EDIT*
Ok I got it to work not sure what did it though. But aftering changing secondform.username = txtusername.text to secondform.username = me.txtusername.text it worked.
And on form2 useing me.caption = username.
Thank you for the help!
-- modified at 19:05 Monday 6th March, 2006
|
|
|
|
|
The best way to do this is store the username in a global variable in the login screen. This variable can be accessed throughout the application.
With Best Regards,
Mayur
-- modified at 23:22 Monday 6th March, 2006
|
|
|
|
|
I have two forms
- Form1
- Form2
On Form1 i have textbox and button
On Form2 i have listbox and button
----------------------------------
I need that if u click on form1 on button that the form2 shows up...
Now on form2 u select an one of 100 items...
U click on button "Insert" and the form2 closes.
The textbox gets the selected item text, buth in position where was the (Ibeam - the cursor i dont know how to explain the line "|" when u typeing.)
----------------------------------
I have tried in manny ways buth can't doo it...
For now i did it like this buth not working:
<code>
Dim sX As Integer
Dim lin As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
sX = TextBox1.SelectionStart
lin = TextBox1.Lines.GetValue(TextBox1.SelectionStart)
Dim f As New Form2
f.ShowDialog()
TextBox1.Select(sX, 0)
TextBox1.Lines(lin).Insert(sX, f.ListBox1.SelectedItem)
End Sub
</code>
Please help me... Thanks
FeRtoll Software.net
--------------------
I fertoll@net.hr I
--------------------
|
|
|
|
|
Please let me know what is your problem?? And what exactly you want to do
regards,
chandana
|
|
|
|
|
Chandana Subasinghe wrote: Please let me know what is your problem?? And what exactly you want to do
lol...
i did told u up there!!!
------------------------
I need that the selected item in listbox on other form goes to first form in text buth in the place where i was typeing...
thats all...
Need to save focus....
FeRtoll Software.net
--------------------
I fertoll@net.hr I
--------------------
|
|
|
|
|
10 days huh? I wish I was given 10 days to finish some of the jobs I have to do at work!
By the looks of this forum lately it seems that many people are doing the same (or similar) assignment.
The answer you seek is in the answer threads of other posts.
Have a look around
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." (Translation: I'll show you the way, but not write the code for you.) I read that somewhere once
|
|
|
|
|
Steve Pullan wrote: The answer you seek is in the answer threads of other posts.
Have a look around
well is it that hard to tell the name of post...
nm...
thanks allot
FeRtoll Software.net
--------------------
I fertoll@net.hr I
--------------------
|
|
|
|
|
FeRtoll wrote: well is it that hard to tell the name of post...
nm...
thanks allot
Well is it THAT hard to actually look up and down the topic lists?
They are right there staring you in the face.
...Steve
quod erat demonstrandum
"Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." (Translation: I'll show you the way, but not write the code for you.) I read that somewhere once
|
|
|
|
|
can u please tell me...
i think that you are wrong, you didnt understand!!!
FeRtoll Software.net
--------------------
I fertoll@net.hr I
--------------------
|
|
|
|
|
Thanks annyway to all.
FeRtoll Software.net
--------------------
I fertoll@net.hr I
--------------------
|
|
|
|
|
I get the following error when I try to update my access table with a datagrid
An unhandled exception of type 'system.invalidoperation" occured in system.data.dll'
The code I am using looks like this:
If CODE_DataSet.HasChanges Then
Dim CON As New OleDbConnection(CONNECT_STRING)
Dim MY_SQL As String
Dim CMD As OleDbCommand
Dim DR As OleDbDataReader
Dim data_adapter As OleDbDataAdapter
Dim command_builder As OleDbCommandBuilder
Dim select_string As String = "SELECT TMP_ADMIN.QUOTE_LINE_NO, TMP_ADMIN.OPTION, TMP_ADMIN.PRODUCT_CODE, TMP_ADMIN.DESCRIPTION, TMP_ADMIN.QTY, TMP_ADMIN.UNIT_COST, TMP_ADMIN.SELL, TMP_ADMIN.TAG FROM TMP_ADMIN;"
CMD = New OleDbCommand(select_string, CON)
data_adapter = New OleDbDataAdapter(select_string, CONNECT_STRING)
data_adapter.TableMappings.Add("Table", CODE_TABLE)
command_builder = New OleDbCommandBuilder(data_adapter)
command_builder.GetUpdateCommand()
data_adapter.Update(CODE_DataSet)
End If
Any ideas? is there a better way to upgrade my MSAccess tables from a datagrid?
|
|
|
|
|
put those on start of class:
Dim CON As New OleDbConnection(CONNECT_STRING)
Dim MY_SQL As String
Dim CMD As OleDbCommand
Dim DR As OleDbDataReader
Dim data_adapter As OleDbDataAdapter
Dim command_builder As OleDbCommandBuilder
what for is this one?
<blink><font color=#FF0000>Dim select_string As String = "SELECT TMP_ADMIN.QUOTE_LINE_NO, TMP_ADMIN.OPTION, TMP_ADMIN.PRODUCT_CODE, TMP_ADMIN.DESCRIPTION, TMP_ADMIN.QTY, TMP_ADMIN.UNIT_COST, TMP_ADMIN.SELL, TMP_ADMIN.TAG FROM TMP_ADMIN;"</font></blink>
you should put that in MY_SQL string up there:
Dim MY_SQL As String="SELECT TMP_ADMIN.QUOTE_LINE_NO, TMP_ADMIN.OPTION, TMP_ADMIN.PRODUCT_CODE, TMP_ADMIN.DESCRIPTION, TMP_ADMIN.QTY, TMP_ADMIN.UNIT_COST, TMP_ADMIN.SELL, TMP_ADMIN.TAG FROM TMP_ADMIN<blink><font color=#FF0000>;</font></blink>" 'And without this one!!! i think...
The third part:
Cmd = New OleDbCommand(MY_SQL, CON)
data_adapter = New OleDbDataAdapter(select_string, CONNECT_STRING)
data_adapter.TableMappings.Add("Table", <blink><font color=#FF0000>CODE_TABLE</font></blink>)
command_builder = New OleDbCommandBuilder(data_adapter)
command_builder.GetUpdateCommand()
data_adapter.Update(CODE_DataSet)
End If
<blink>And i dont see annywhere that u have defined the "CODE_TABLE" variable.
I think i have helped you... Good luck
FeRtoll Software.net
--------------------
I fertoll@net.hr I
--------------------
|
|
|
|
|
In your TMP_ADMIN table, do you have a primary key field? Are you returning that field in your SELECT statement? If not, you'll have to make one to use it with a DataAdapter.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|